[R] Reversing axis in a log plot

From: Christian Marquardt <marquardt.christian_at_gmail.com>
Date: Fri 20 May 2005 - 00:29:58 EST


apologies if I'm overlooking the obvious... I would like to revert a logarithmic axis with R 2.1.0 on Linux, e.g. for using pressure as a vertical coordinate. Say we have

  x = seq(1,3, by = 0.01)
  y = exp(x)

Plotting and reversing linear axis is fine

   plot(x,y, ylim = c(30,1))

as is a usual log-plot:

  plot(x,y, log = "y", ylim = c(1,30))


  plot(x,y, log = "y", ylim = c(30,1))

fails with

  Error in axis(2, ...) : log - axis(), 'at' creation, _SMALL_ range: invalid {xy}axp or par;

         axp[0]= 10, usr[0:1]=(34.3721,0.872801)   In addition: Warning message:
  CreateAtVector "log"(from axis()): usr[0] = 34.3721 > 0.872801 = usr[1] !

What am I doing wrong here?

Thanks a lot,


R-help@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 Received on Fri May 20 00:35:35 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:52 EST