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 Departement of Mathematics Faculty of Sciences Sherbrooke University Sherbrooke (Quebec) Canada e-mail : bernard.colin at usherbrooke.ca
Try the par(mfrow=c(x,y)) command which sets up x rows and y columns of subplots: -- View this message in context: http://www.nabble.com/Re-%3A-I-need-some-help-please%21-tf3858641.html#a10932455 Sent from the R help mailing list archive at Nabble.com.
--- Bernard Colin <Bernard.Colin at USherbrooke.ca> wrote:> > 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??par mfcol, mfrow A vector of the form c(nr, nc). Subsequent figures will be drawn in an nr-by-nc array on the device by columns (mfcol), or rows (mfrow), respectively.
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 ColinYou'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
Bernard Colin wrote:> 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?Assuming you want to overlay multiple data sets on the same axes, verify that in your first plot statement you got your axis ranges wide enough to capture all your data sets, because they won't adjust when you add data. If you want adjacent plots in the same window, use lattice (trellis) graphics. -- --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k