I am trying to plot positions on a grid where the x and y axis equate to longitudinal and latitudinal co-prdinates respectively. As these co-ordinates are southings and westings, i need the origin of my graph to contain the two highest values of each co0ordinate, with the values decreasing in both respects along both axes - I cannot seem to find any function within r to allow me to do this. Also, how can i avoid r automatically rescaling my data - my data points are not evenly clustered and I want the scalings on the x and y axes to be the same, so that they represent a true picture of the spatial scattering. R rescales the data to fit the best "square" in each case - misrepresenting the scaling of my data. I have looked at all the options within par() and axis() and nothing here appears appropriate. Thanks in advance.. Laura
If you want to preserve the aspect ratio of x and y axis, use asp=1 within the plot function. To reverse the direction of the x and y axes, if I understand correctly what you are trying to do, I am not sure. There may be more efficient ways. What I would do is something along the following lines: plot(-x,-y, xast='n', yaxt='n') and set manually the axis labelling. HTH Giovanni -- __________________________________________________ [ ] [ Giovanni Petris GPetris at uark.edu ] [ Department of Mathematical Sciences ] [ University of Arkansas - Fayetteville, AR 72701 ] [ Ph: (479) 575-6324, 575-8630 (fax) ] [ http://definetti.uark.edu/~gpetris/ ] [__________________________________________________]> Date: Fri, 07 Nov 2003 13:06:46 +0000 (GMT) > From: Laura Quinn <laura at env.leeds.ac.uk> > Sender: r-help-bounces at stat.math.ethz.ch > Precedence: list > > I am trying to plot positions on a grid where the x and y axis equate to > longitudinal and latitudinal co-prdinates respectively. As these > co-ordinates are southings and westings, i need the origin of my graph to > contain the two highest values of each co0ordinate, with the values > decreasing in both respects along both axes - I cannot seem to find any > function within r to allow me to do this. > > Also, how can i avoid r automatically rescaling my data - my data points > are not evenly clustered and I want the scalings on the x and y axes to be > the same, so that they represent a true picture of the spatial scattering. > R rescales the data to fit the best "square" in each case - > misrepresenting the scaling of my data. I have looked at all the options > within par() and axis() and nothing here appears appropriate. > > Thanks in advance.. > Laura > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > >
Hi Laura Quinn wrote:> I am trying to plot positions on a grid where the x and y axis equate to > longitudinal and latitudinal co-prdinates respectively. As these > co-ordinates are southings and westings, i need the origin of my graph to > contain the two highest values of each co0ordinate, with the values > decreasing in both respects along both axes - I cannot seem to find any > function within r to allow me to do this.If you specify the axis limits as (highest, lowest), R should do the rest. For example, ... x <- -10:5 y <- exp(x) par(mfrow=c(1,2)) plot(x, y, type="l") plot(x, y, type="l", xlim=c(5, -10), ylim=c(150, 0)) Paul -- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/