[R] Reversing axis in a log plot

Petr Pikal petr.pikal at precheza.cz
Fri May 20 08:33:45 CEST 2005


Hi Christian

I did not see any response to your question yet, and my will not be 
very helpful. The error message comes from axis building, plot 
itself seems to be OK. If you choose slightly bigger value for ylim 
it will go through without any complain.

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

Seems to me as a bug in axis. If you do not get any other response 
try to send it to r-bugs.

Cheers
Petr



On 19 May 2005 at 15:29, Christian Marquardt wrote:

> Hello,
> 
> 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)
>    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] !
> 
> What am I doing wrong here?
> 
> Thanks a lot,
> 
>   Christian.
> 
> ______________________________________________
> 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

Petr Pikal
petr.pikal at precheza.cz




More information about the R-help mailing list