Skip to content

plot layout with several plots ON plot area of previous plot

8 messages · Rainer M Krug, Jim Lemon, Greg Snow

#
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

I would like to have a plot layout, on which line graphs are on the plot
area of an underlying bar graph.
How can I achieve this? I know about layout() and par() to create a
layout, but as far as I know, they assign non-overlapping plot areas.

Effectively, it should look as below:

|------------------------|
|                        |
|      |---|  |---|      |
|      |   |  |   |      |
|      |   |  |   |      |
|      |-L-|  |-L-|      |
|                        |
|                        |
|                        |
|                        |
|                        |
|                        |
|-the bargraph-----------|

L: the line graphs

Any help appreciated,

Rainer



- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Tel:        +33 - (0)9 53 10 27 44
Cell:       +27 - (0)8 39 47 90 42
Fax (SA):   +27 - (0)8 65 16 27 82
Fax (D) :   +49 - (0)3 21 21 25 22 44
Fax (FR):   +33 - (0)9 58 10 27 44
email:      Rainer at krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2dg3UACgkQoYgNqgF2egpegwCfbqQP19qZqyof21+rA9Cbn+Vf
UKcAnAgl6AoUNcygx/sSaMcYV+zoum/S
=9/P0
-----END PGP SIGNATURE-----
#
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 07/04/11 11:27, Rainer M Krug wrote:
Sorry - did not do my homework and forgot to google - found the solution
(http://tolstoy.newcastle.edu.au/R/help/04/11/6449.html).

But an additional question - uis there a way to position the plots in
relation to the co-ordinates of the first plot, i.e. the x axis of the
first plot (ehich covers the whole plot area) is from 1 to 6 - can I
position the second overlapping plot over the x-coordinate 3 of the
first plot?

Rainer
- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Tel:        +33 - (0)9 53 10 27 44
Cell:       +27 - (0)8 39 47 90 42
Fax (SA):   +27 - (0)8 65 16 27 82
Fax (D) :   +49 - (0)3 21 21 25 22 44
Fax (FR):   +33 - (0)9 58 10 27 44
email:      Rainer at krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2dhmMACgkQoYgNqgF2egqysACeMJ0nl81wSBlr8w4s7sM2Zo2k
gvUAnjTlzoFoOnDHPzbziRAbS/8MbV0p
=LYr+
-----END PGP SIGNATURE-----
#
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 07/04/11 12:53, Jim Lemon wrote:
Exactly - why is such a gem of a function hiding in a package with Demos
in the name? I would never have thought about that.

Thanks a lot,

Rainer
- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Tel:        +33 - (0)9 53 10 27 44
Cell:       +27 - (0)8 39 47 90 42
Fax (SA):   +27 - (0)8 65 16 27 82
Fax (D) :   +49 - (0)3 21 21 25 22 44
Fax (FR):   +33 - (0)9 58 10 27 44
email:      Rainer at krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2di+YACgkQoYgNqgF2egqR2ACdE8w+uvtDXtd09ml3L3DYwtas
uesAn3emEYA7679U4Z7RfZO80T0p0pZ/
=iRDW
-----END PGP SIGNATURE-----
#
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 07/04/11 13:09, Jim Lemon wrote:
Nothing to add :-)

Rainer
- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Tel:        +33 - (0)9 53 10 27 44
Cell:       +27 - (0)8 39 47 90 42
Fax (SA):   +27 - (0)8 65 16 27 82
Fax (D) :   +49 - (0)3 21 21 25 22 44
Fax (FR):   +33 - (0)9 58 10 27 44
email:      Rainer at krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2dkTQACgkQoYgNqgF2egoDlQCeLqIYerpiuIdsACLwq/PwpTkX
v6gAn3ELKBe5StvYvL6/Iq9JpMumPyu8
=HNIS
-----END PGP SIGNATURE-----
#
On 04/07/2011 07:39 PM, Rainer M Krug wrote:
Hi Rainer,
I think you want the subplot function in the TeachingDemos package.

Jim
#
On 04/07/2011 08:03 PM, Rainer M Krug wrote:
Maybe Greg thought it was a package for the people.

Jim
1 day later
#
Some of the functions that were the first in the TeachingDemos package were originally written to help me visualize something, so it is not just teachers demoing, but people demoing to themselves.  It has become a bit of a misc package with several utilities that are useful in themselves, but while I have considered splitting the package, I don't see an obvious splitting (and what would I call the new part?, naming things is not my strongest talent, just look at some of the functions in TeachingDemos, luckily for my kids my wife invoked veto power there).

If someone wanted to include the function in one of the core packages then I would be happy to donate it, though generally that means one of the core members taking over maintenance and they may not want to do that (and I am happy to keep doing so).  One of my small claims to fame is that there have been 3 instances of code in the TeachingDemos package that apparently had the right combination of potential usefulness and ugly code or implementation that inspired Brian Ripley to write new functions in the core packages to do the same thing (only better).  The subplot function has not been one of those, so I am guessing that Prof. Ripley (or other core members) either has not become aware of it, does not think it useful enough, or does not consider it ugly enough to ne rewriting (I am hoping it's the last).

Personally I think the TeachingDemos package is useful and everyone should use it (but I may be a bit biased).  I sometimes fantasize about it becoming one of the official recommended packages (but the realistic part of me admits that this is only slightly more likely to happen than the fantasy about developing super powers or having the entire house stay clean for a whole day with 4 kids at home).

Luckily Jim (and others) is good at pointing people to TeachingDemos when it is appropriate.  I try to point people to Jim's package as well, but he is usually a bit faster about it.
2 days later
#
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 08/04/11 18:47, Greg Snow wrote:
Hi Greg,

I must say I thoroughly enjoyed reading your response and reasoning and
I will definitely take a closer look into the TeahingDemos package.

Cheers,

Rainer

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer at krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2iw9sACgkQoYgNqgF2egqDYwCeP6j7rReGPlkgwYx4lcNyC4j5
qc0AoIle1bkl8Zwf0TIn83WLfB1aikTd
=TlQ/
-----END PGP SIGNATURE-----