[R] Again on overlaying plots (a plot region within a plot region)

Charlotte Maia maiagx at gmail.com
Wed Dec 2 10:26:19 CET 2009


Hi Ottorino-Luca,

I'm not sure how flexible the layout command is off the top of my head.
I have never seen an example of what you describe using layout, so I
will assume it can't be done.

One option is to use grid and lattice.
This is possibly the best option if you are planning to do a lot of
this sort of thing.

Another option is to plot the second plot, on top of the first plot,
using primitives such as points and lines, transforming your
coordinates so that they match the coordinates of the first plot. This
will be very difficult if you wish to put titles and axis on the
nested plot, however simple if you restrict yourself to points and
lines. Finding documentation and examples of R's graphical primitives
should be easy.

At the risk of sounding crude, I'm pretty sure both latex and many
word processors allow one position one figure on top of another. This
would seem the simplest solution for a one off job.

Further to my post on R-devel, I recommend not using png format,
except where absolutely necessary.

regards
-- 
Charlotte Maia
http://sites.google.com/site/maiagx/home




More information about the R-help mailing list