I would like to produce a graph which plots a log scale variable on the y-axis but have the tick marks on the y-axis be the non log transformed values that are round like .5, 1, 2, 3, 4 etc. Has anyone done something like this in the past? How did you implement it in the code? Thanks, Dean
On Tue, 12 Oct 2004, Dean Sonneborn wrote:> I would like to produce a graph which plots a log scale variable on the > y-axis but have the tick marks on the y-axis be the non log transformed > values that are round like .5, 1, 2, 3, 4 etc. Has anyone done something > like this in the past? How did you implement it in the code?plot(c(0.5, 5), 1:2, log="x", xaxt="n") axis(1, at=c(0.5, 1:4)) Take a look at `An Introduction to R' and ?axis. BTW, please try to use a more precise subject line. Something like `Adding a custom axis to log-scale plots'? -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Dean -- I believe just setting log = "y" in your plot command should do this. For example:> plot(runif(100, 1, 100), runif(100, 1, 100), log = "xy")gives me tick marks at 2, 5, 10, 20, 50, and 100. (YMMV because of the random numbers.) Hope this helps, Matt Wiener -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Dean Sonneborn Sent: Tuesday, October 12, 2004 2:02 PM To: R-help at stat.math.ethz.ch Subject: [R] graph question I would like to produce a graph which plots a log scale variable on the y-axis but have the tick marks on the y-axis be the non log transformed values that are round like .5, 1, 2, 3, 4 etc. Has anyone done something like this in the past? How did you implement it in the code? Thanks, Dean ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html