Re: [R] [ggplot] trouble with ggabline and log-log-plots

From: Sebastian Weber <>
Date: Wed 25 Oct 2006 - 07:25:08 GMT

> Yes, but for abline (the way it is currently written) to work out
> where that line should go, uses the equation y = mx + c. In this
> case, where c = 0, or -infinity on the log scale, y is going to be
> -infinty for the entire range of x's. I don't see how to interpret
> the specification in a consistent manner otherwise.

Ah, I start seeing the point. What I actually want to verify is the power-law. So in a log-log case the line would mean in the lin-lin world a relation y = a x^b which will become log(y) = log(a) + b log(x). Nevertheless I see the problem, that for any transformation, one would need a different function which ggabline uses. One possible ansatz would be to let ggabline plot the function y' = m x' + c where y' and x' are the transformed variables log(y) and log(x) (or whatever else transformation is in use). This should yield straight lines with whatever transformation one uses, if I don't miss anything.

> > I wrote some functions which do produce nice tick-marks with
> > lattice-plots, but the syntax is really messy. However, my functions can
> > produce lists with at and label members with according ticks. If you
> > like, I sent them to you along with an example plot.
> Yes, I'd like to see them. If the algorithm is good, I'm happy to
> clean up the code and include it.

Ok, I will send you my code directly.


Sebastian Weber

> Regards,
> Hadley mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu Oct 26 02:55:36 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 25 Oct 2006 - 18:30:17 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.