[R] side by side plots

Dylan Beaudette dylan.beaudette at gmail.com
Mon Jan 7 22:24:59 CET 2008


On Monday 07 January 2008, hpbenton at scripps.edu wrote:
> Hello everyone,
>
> I have an overlay plot it's nice but you can't see all the data. I would
> like to know if there is a way to get a plot that gives a side by side
> plot so that  each plot would be next to each other. The two plots have
> the same data are of different species. At the moment this is the code I'm
> using:
>
> exp<-cbind(abs(round(rnorm(10),2)*10), seq(100, 200, by=10))
> ref<-cbind(abs(round(rnorm(10),2)*10), seq(100, 200, by=10))
>
> plot(ref, ylab="Intensity", xlab="wavelength", type="h")
> points(exp, type="h", col="red")
>
> This is working in a script and I would like to have a single pdf/png file
> for the user with this plot, rather than asking the user to manually
> compare them.
>
> Any ideas on how I would do this?
>
> Thanks
>
> Paul

have a look at ?par , specifically par(mfcol=c(...))

cheers,
Dylan



-- 
Dylan Beaudette
Soil Resource Laboratory
http://casoilresource.lawr.ucdavis.edu/
University of California at Davis
530.754.7341




More information about the R-help mailing list