jzhang10 wrote:
Hi,
I want to insert a small figure into a bigger plot. I saw people are doing this all the time, but I just could not figure out how to do it in R.
Thanks for your help!
Jinfeng Zhang
There are a number of ways to do this in R; some pointers to get you started ...
(i) par(new=TRUE) allows you to overlay several plots on the same page
(ii) par(fig) and par(plt) provide fine control over where a plot appears on a page
(iii) accurately locating subplots within a bigger plot may require some conversions between coordinate systems; par("usr"), par("plt"), ... can be used to obtain information on current coordinate systems
(iv) you can have all the transformations done for you, by using the grid package to create viewports and the gridBase package to align them with a bigger plot - see the recent R News article "Integrating grid Graphics Output with Base Graphics Output" (http://cran.stat.auckland.ac.nz/doc/Rnews/Rnews_2003-2.pdf)
Paul -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 [EMAIL PROTECTED] http://www.stat.auckland.ac.nz/~paul/
______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
