hi, is it possible to draw a plot inside another plot f.e in the upper right corner. I do not mean the possbility par(mfrow = c(2,2). Kind Regards Knut
Not in R base graphics, but you can do easily with the grid package. Best, Uwe Ligges On 01.11.2010 11:59, Knut Krueger wrote:> hi, > > is it possible to draw a plot inside another plot f.e in the upper right > corner. I do not mean the possbility > par(mfrow = c(2,2). > > > Kind Regards > Knut > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Hi I remember that I did it also in base graphics but it took me some time to find out how and it was a long time ago so. If I remember it correctly it was some combination of graphic parameters to set user coordinates and do not overwrite the first plot by setting par(new=TRUE) Regards Petr r-help-bounces at r-project.org napsal dne 01.11.2010 12:10:18:> Not in R base graphics, but you can do easily with the grid package. > > Best, > Uwe Ligges > > > On 01.11.2010 11:59, Knut Krueger wrote: > > hi, > > > > is it possible to draw a plot inside another plot f.e in the upperright> > corner. I do not mean the possbility > > par(mfrow = c(2,2). > > > > > > Kind Regards > > Knut > > > > ______________________________________________ > > R-help at r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide > > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.
On 11/01/2010 09:59 PM, Knut Krueger wrote:> hi, > > is it possible to draw a plot inside another plot f.e in the upper right > corner. I do not mean the possbility > par(mfrow = c(2,2). >Hi Knut, Try the subplot function in the TeachingDemos package. Jim
Here's a quick example I posted on my blog. http://chartsgraphs.wordpress.com/2009/05/06/r-lets-you-put-chart-inside-chart/ link Hope it helps. http://r.789695.n4.nabble.com/file/n3022363/chart_inside_chart.png -- View this message in context: http://r.789695.n4.nabble.com/Plots-inside-a-Plot-tp3021988p3022363.html Sent from the R help mailing list archive at Nabble.com.
Petr is correct,I believe, but see also ?layout for a (newer and) more flexible approach to splitting the screen into a non-matricial arrangement to overlay several plots. ?split.screen can also do this, but is somewhat clumsier to use imo. Cheers, Bert On Mon, Nov 1, 2010 at 4:27 AM, Petr PIKAL <petr.pikal at precheza.cz> wrote:> Hi > > I remember that I did it also in base graphics but it took me some time to > find out how and it was a long time ago so. > > If I remember it correctly it was some combination of graphic parameters > to set user coordinates and do not overwrite the first plot by setting > par(new=TRUE) > > Regards > Petr > > > > > r-help-bounces at r-project.org napsal dne 01.11.2010 12:10:18: > >> Not in R base graphics, but you can do easily with the grid package. >> >> Best, >> Uwe Ligges >> >> >> On 01.11.2010 11:59, Knut Krueger wrote: >> > hi, >> > >> > is it possible to draw a plot inside another plot f.e in the upper > right >> > corner. I do not mean the possbility >> > par(mfrow = c(2,2). >> > >> > >> > Kind Regards >> > Knut >> > >> > ______________________________________________ >> > R-help at r-project.org mailing list >> > https://stat.ethz.ch/mailman/listinfo/r-help >> > PLEASE do read the posting guide >> > http://www.R-project.org/posting-guide.html >> > and provide commented, minimal, self-contained, reproducible code. >> >> ______________________________________________ >> R-help at r-project.org mailing list >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Bert Gunter Genentech Nonclinical Biostatistics
here's a second example using basic R graphics. I update this chart daily. http://processtrends.com/images/RClimate_UAH_Ch5_latest.png link http://r.789695.n4.nabble.com/file/n3022678/RClimate_UAH_Ch5_latest.png Here's what ?par says about par(fig) fig A numerical vector of the form c(x1, x2, y1, y2) which gives the (NDC) coordinates of the figure region in the display region of the device. If you set this, unlike S, you start a new plot, so to add to an existing plot use new=TRUE as well. -- View this message in context: http://r.789695.n4.nabble.com/Plots-inside-a-Plot-tp3021988p3022678.html Sent from the R help mailing list archive at Nabble.com.