Dear all, I want to make a plot where I can specify the range of y axis. I am using the interaction.plot command and because the values of y axis are from 2 to 500, I am using a logarithmic scale.>interaction.plot(speclong$Date,speclong$time2,speclong$outcome,xaxt="n",type="l",pch=20,xlab="", log="y", ylab="Concentration (ug/L)",trace.label="",col=rainbow(7))The plot itself gives me a y scale displaying ticks at 2, 5, 10, 20, 100, 200, 500. I would like to get a y scale where it would display ticks at every 4 marks, at 2, 20, 100 and 500. I tried ylim=c(2,20,100,500) but nothing happened. Actually I got an error. Could you help me? Thank you. Maria [[alternative HTML version deleted]]
If you would provide a reproducible example, even a dummy example, I could give it a shot. Otherwise look for something like "break". On Tue, Aug 31, 2010 at 11:18 AM, Lathouri, Maria <m.lathouri06 at imperial.ac.uk> wrote:> Dear all, > > I want to make a plot where I can specify the range of y axis. I am using the interaction.plot command and because the values of y axis are from 2 to 500, I am using a logarithmic scale. > >>interaction.plot(speclong$Date,speclong$time2,speclong$outcome,xaxt="n",type="l",pch=20,xlab="", log="y", ylab="Concentration (ug/L)",trace.label="",col=rainbow(7)) > > > > The plot itself gives me a y scale displaying ticks at 2, 5, 10, 20, 100, 200, 500. I would like to get a y scale where it would display ticks at every 4 marks, at 2, 20, 100 and 500. > > > > I tried ylim=c(2,20,100,500) but nothing happened. Actually I got an error. > > > > Could you help me? > > > > Thank you. > > > > Maria > > > ? ? ? ?[[alternative HTML version deleted]] > > ______________________________________________ > 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. >-- Stephen Sefick ____________________________________ | Auburn University? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? | | Department of Biological Sciences? ? ? ? ?? | | 331 Funchess Hall? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | | Auburn, Alabama? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? | | 36849? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | |___________________________________| | sas0025 at auburn.edu? ? ? ? ? ? ? ? ? ? ? ? ? ?? | | http://www.auburn.edu/~sas0025? ? ? ? ? ?? | |___________________________________| Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us feel like gods.? We are mammals, and have not exhausted the annoying little problems of being mammals. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? -K. Mullis "A big computer, a complex algorithm and a long time does not equal science." ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? -Robert Gentleman
On Tue, 2010-08-31 at 17:18 +0100, Lathouri, Maria wrote:> Dear all, > > I want to make a plot where I can specify the range of y axis. I am using the interaction.plot command and because the values of y axis are from 2 to 500, I am using a logarithmic scale. > > >interaction.plot(speclong$Date,speclong$time2,speclong$outcome,xaxt="n",type="l",pch=20,xlab="", log="y", ylab="Concentration (ug/L)",trace.label="",col=rainbow(7)) > > > > The plot itself gives me a y scale displaying ticks at 2, 5, 10, 20, 100, 200, 500. I would like to get a y scale where it would display ticks at every 4 marks, at 2, 20, 100 and 500. > > > > I tried ylim=c(2,20,100,500) but nothing happened. Actually I got an error.ylim needs to be the extreme limits of the axis, i.e. a vector of length 2. Suppress axis plotting and then draw your own: interaction.plot(...., axes = FALSE) axis(2, at = c(2,20,100,500)) E.g., using the example in ?interaction.plot> with(ToothGrowth, interaction.plot(dose, supp, len, fixed=TRUE, axes = FALSE)) > axis(2, at = c(10, 20)) > axis(1) > box()Does that help? G> > > > Could you help me? > > > > Thank you. > > > > Maria > > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.-- %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~% Dr. Gavin Simpson [t] +44 (0)20 7679 0522 ECRC, UCL Geography, [f] +44 (0)20 7679 0565 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/ UK. WC1E 6BT. [w] http://www.freshwaters.org.uk %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%