Skip to content

Reversing axis in a log plot (PR#7894)

1 message · Uwe Ligges

#
Yes, this one is a bug in CreateAtVector, plot.c.
It already has the lines:


     /* Debugging: When does the following happen... ? */
     if (umin > umax)
         warning("CreateAtVector \"log\"(from axis()): "
             "usr[0] = %g > %g = usr[1] !", umin, umax);


And now we know that it happens if (and only if?????) the logarithmic 
scale is not very small (i.e. axp[2] > 0, this is equal to R's 
par("yaxp")[3] in your example) and the axis are reversed (umin > umax).

I'll try to provide a fix which should be possible by reversing 
arguments axp and usr in this case and returning a reversed at ...

Uwe Ligges
marquardt.christian@gmail.com wrote: