People, I want to create seven plots on the one graph - each with it's own Y axis and scale - I want the plots overlaid because it is the shape of the graphs that I want to compare, not so much the values. I have found examples where people show how to put two Y axes on the left of the plot but I couldn't find examples of any more than that - is it possible? Thanks, Phil. -- Philip Rhoades GPO Box 3411 Sydney NSW 2001 Australia E-mail: phil at pricom.com.au
Dear Philip, If the values are not important, then you don't need different Y-axes. Why not standardise the seven datasets so they have a common scale? Best regards, Thierry ---------------------------------------------------------------------------- ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie & Kwaliteitszorg Gaverstraat 4 9500 Geraardsbergen Belgium Research Institute for Nature and Forest team Biometrics & Quality Assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 Thierry.Onkelinx at inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey> -----Oorspronkelijk bericht----- > Van: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] > Namens Philip Rhoades > Verzonden: donderdag 16 juni 2011 11:12 > Aan: R help > Onderwerp: [R] Multiple (7) Y axes? > > People, > > I want to create seven plots on the one graph - each with it's own Y axis and > scale - I want the plots overlaid because it is the shape of the graphs that I want > to compare, not so much the values. I have found examples where people show > how to put two Y axes on the left of the plot but I couldn't find examples of any > more than that - is it possible? > > Thanks, > > Phil. > -- > Philip Rhoades > > GPO Box 3411 > Sydney NSW 2001 > Australia > E-mail: phil at pricom.com.au > > ______________________________________________ > 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.
On 06/16/2011 07:12 PM, Philip Rhoades wrote:> People, > > I want to create seven plots on the one graph - each with it's own Y > axis and scale - I want the plots overlaid because it is the shape of > the graphs that I want to compare, not so much the values. I have found > examples where people show how to put two Y axes on the left of the plot > but I couldn't find examples of any more than that - is it possible? >Hi Phil, You could do something like this by plotting the first plot, adding the subsequent plots with "lines" or "points" and stacking the axes using the "pos" argument that allows you to offset the axis. Jim
Try something like: par(mar=c(4,2,1,12),tcl=0.2,mgp=c(1,0,0)) plot(1:10,1:10) for (i in 1:7) { par(new=TRUE) plot(1:10,(i+(1:10)+rnorm(10,0,0.4)),yaxt='n',col=i,type='l') axis(4,line=(i-1)*1.5,col=i-1,col.ticks=i-1) } You may need to tweek around the options a bit and check that the tickmarks are actually labelling the correct axes and that the colors correspond....I did not check this thoroughly! HTH Jannis --- Philip Rhoades <phil at pricom.com.au> schrieb am Do, 16.6.2011:> Von: Philip Rhoades <phil at pricom.com.au> > Betreff: [R] Multiple (7) Y axes? > An: "R help" <r-help at stat.math.ethz.ch> > Datum: Donnerstag, 16. Juni, 2011 09:12 Uhr > People, > > I want to create seven plots on the one graph - each with > it's own Y axis and scale - I want the plots overlaid > because it is the shape of the graphs that I want to > compare, not so much the values.? I have found examples > where people show how to put two Y axes on the left of the > plot but I couldn't find examples of any more than that - is > it possible? > > Thanks, > > Phil. > -- Philip Rhoades > > GPO Box 3411 > Sydney NSW? ? 2001 > Australia > E-mail:? phil at pricom.com.au > > ______________________________________________ > 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. >