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

Sebastian Weber sebastian.weber at physik.tu-darmstadt.de
Tue Oct 24 22:44:20 CEST 2006


Hi!

> > pl1 <- qplot(correlFunc, correlFunc.ref, data=all, log=c("xy"))
> > pl1 <- ggabline(pl1, slope=1, intercept=0)
> > print(pl1) ## no line in plot :(
> 
> I'm not really sure what the correct behaviour is here.  What do you
> expect this line to look like?  It has intercept 0, which is -infinity
> on the log scale, so where should I start drawing the line?

Well, my data does not start at 0 either (no log-log plot starts at 0).
I think the line should start where the data-points start at. So, one
can should be able to get this from the range where the values are
plotted.

> You should be able to specify them explicity using pscontinuous.  But
> in general, coming up with nice tick marks is a very difficult problem
> and my heuristics aren't very good.  Any suggestions would be
> welcomed.

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.

Greetings,

Sebastian Weber

> 
> Hadley



More information about the R-help mailing list