From marquardt.christian at gmail.com  Tue May 24 18:17:10 2005
From: marquardt.christian at gmail.com (marquardt.christian@gmail.com)
Date: Tue May 24 18:17:16 2005
Subject: [Rd] Reversing axis in a log plot (PR#7894)
Message-ID: <20050524161710.EC4F7ECDF@slim.kubism.ku.dk>

Full_Name: Christian Marquardt
Version: 2.1.0
OS: Linux (Redhat 9)
Submission from: (NULL) (151.170.240.10)


Following the advice of a reader of R-help, I would now like to submit this as a
bug report:

Say we have

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

Plotting and reversing linear axis is fine

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

as is a usual log-plot:

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

However,

  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] !


According to Petr Pikal <petr.pikal -at- precheza.cz>, replacing the ylim
argument by ylim = c(30,1.2) helps in the above example; but in my real world
applications, it's actually difficult to find a working value for ylim.

I hope this is useful,

  Christian.


[Rd] Reversing axis in a log plot (PR#7894)
marquardt.christian@gmail.com