Re: [R] ggplot2: bug in geom_ribbon + log scale!?

From: Martin Rittner <kmr_at_thegeologician.net>
Date: Sun, 17 Feb 2008 22:02:50 +0000

'works nicely with loging the values. Thank you very much!

Keep on the great work, the more I use ggplot2, the more I love it!

Greetings, Martin

h.wickham_at_gmail.com wrote:
> Yes, that's a bug in the current version (fixed in the development
> version) - the problem is that the min and max aesthetics aren't being
> correctly scaled. You can fix it by explicitly logging those values,
> or I can send you the development version off list if you remind me of
> your OS.
>
> Hadley
>
> On 2/17/08, Martin Rittner <kmr_at_thegeologician.net> wrote:
>
>> Hi everyone, Hadley,
>>
>> it seems there's a bug in geom_ribbon() when using it in a log-scaled plot:
>>
>> d<-data.frame(x=c(1:20),y1=rnorm(20)+3,y2=rnorm(20)+5)
>> p<-ggplot()
>> p<-p+geom_ribbon(data=d,aes(x=d[["x"]],min=d[["y1"]],max=d[["y2"]]))
>> p<-p+geom_line(data=d,aes(x=d[["x"]],y=d[["y1"]]),colour="blue")
>> p<-p+geom_line(data=d,aes(x=d[["x"]],y=d[["y2"]]),colour="red")
>> p2+scale_y_continuous()
>>
>> ...gives the plot I want, only with my actual data, I'd need it in
>> log-scale:
>>
>> p2+scale_y_log10()
>>
>> shifts the ribbon far above the actual data (factor 1000, if I see it
>> right, but I haven't tested it with different data to check on that...).
>>
>> I'm using the latest version of ggplot2 (0.5.7).
>>
>> Has anyone any suggestions for a workaround/patch?
>>
>> Many Thanks, Martin
>>
>> ______________________________________________
>> R-help_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
>
>
>



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun 17 Feb 2008 - 22:05:36 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 17 Feb 2008 - 23:30:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive