Thomas Kellermann
unread,Mar 19, 2009, 10:40:08 AM3/19/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ggplot2
Hello all,
I have a small problem with scale_y_continuous() and the limits-
argument there.
To create a barplot, I used the following code, which works:
df <- data.frame(x = c("A","B","C"), y=c(2,3,2))
ggplot() + geom_bar(data=df, mapping=aes(x=x,y=y))
Setting the limits on the y-axis from 0 to 5 also works:
ggplot() + geom_bar(data=df, mapping=aes(x=x,y=y)) + scale_y_continuous
(limits=c(0,5))
But setting the limits from 1 to 5 makes the bars disappear:
ggplot() + geom_bar(data=df, mapping=aes(x=x,y=y)) + scale_y_continuous
(limits=c(1,5))
I wonder, if this is a bug or my fault...
Best regards,
Thomas