DJNordlund@aol.com
2004-May-22 18:18 UTC
[R] How to define specific location of tick marks in plot()
Hi, I wish to create a series of plots with the same x-axis range and the same placement of tick marks. In addition I want to force the tick marks to be at specific locations. For example, if I wish to have an x-axis which goes from 40 to 110, with tick marks at 40, 50, 60, ... , How can I accomplish that? The various parameters I have tried changing just seem to be suggestions for an internal definition. I'm sure this is easy, but I'm obviously missing something in the docmentation. Dan Nordlund
Prof Brian Ripley
2004-May-22 18:40 UTC
[R] How to define specific location of tick marks in plot()
On Sat, 22 May 2004 DJNordlund at aol.com wrote:> I wish to create a series of plots with the same x-axis range and the > same placement of tick marks. In addition I want to force the tick > marks to be at specific locations. For example, if I wish to have an > x-axis which goes from 40 to 110, with tick marks at 40, 50, 60, ... , > How can I accomplish that? The various parameters I have tried changing > just seem to be suggestions for an internal definition. > > I'm sure this is easy, but I'm obviously missing something in the > docmentation.par(xaxs="d") is what you want, but it is not currently implemented. So for now use xaxt="n" and then call axis() with at=. plot(20:120, 20:120, xaxt="n") axis(1, at = seq(40, 110, 10)) -- 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
DJNordlund@aol.com
2004-May-22 20:58 UTC
[R] How to define specific location of tick marks in plot()
Thanks to Prof. Ripley for the rapid response and solution. The R developers and contributors to this list are very helpful and generous with their time and advice. Dan Nordlund In a message dated 5/22/2004 11:41:13 AM Pacific Daylight Time, ripley at stats.ox.ac.uk writes: On Sat, 22 May 2004 DJNordlund at aol.com wrote:> I wish to create a series of plots with the same x-axis range and the > same placement of tick marks. In addition I want to force the tick > marks to be at specific locations. For example, if I wish to have an > x-axis which goes from 40 to 110, with tick marks at 40, 50, 60, ... , > How can I accomplish that? The various parameters I have tried changing > just seem to be suggestions for an internal definition. > > I'm sure this is easy, but I'm obviously missing something in the > docmentation.par(xaxs="d") is what you want, but it is not currently implemented. So for now use xaxt="n" and then call axis() with at=. plot(20:120, 20:120, xaxt="n") axis(1, at = seq(40, 110, 10)) -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Te: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595