[R] Re : I need some help please!

J.delasHeras at ed.ac.uk J.delasHeras at ed.ac.uk
Sun Jun 3 17:21:14 CEST 2007


Quoting Bernard Colin <Bernard.Colin at usherbrooke.ca>:

>
> To whom it may concern,
>
> I want to plot two or more graphics in the same window by the means of the
> "plot" command. To do that, I have tried the "add=TRUE" option, but this last
> one does not work! Do you have an hint for me please?
>
> Thank you very much for your attention.
>
> Bernard Colin

You've already been offered the par(mfrow=c(x,y)) option, to plot  
multiple graphs into one figure.

If what you want is to plot something, and then add another one _on  
top_ of it, there are various ways to do that.
If you're plotting lines, points, etc... you can simply use 'plot' for  
the first one, and 'lines' or 'points' for the others.
Sometimes that's not good enough, in which case you should look at  
?par again, and check the effect of par(new=T).
You can make one plot, then call par(new=T) and plot again... the  
second plot gets drawn right on top of the first. You may have to plot  
without the automatic axis drawing, and specify the axes yourself  
(?axis)... that is also teh way to show multiple axes in plots (say a  
common X and two different Y axes... etc).

Jose


-- 
Dr. Jose I. de las Heras                      Email: J.delasHeras at ed.ac.uk
The Wellcome Trust Centre for Cell Biology    Phone: +44 (0)131 6513374
Institute for Cell & Molecular Biology        Fax:   +44 (0)131 6507360
Swann Building, Mayfield Road
University of Edinburgh
Edinburgh EH9 3JR
UK



More information about the R-help mailing list