Re: [R] ggplot: Trouble with xlim() and discrete scales

2010-05-10 Thread John Rauser
May I ask for further illumination of my dumbness? I had been merrily plotting ..density.. and using xlim() to constrain the x-axis like this and everything was working fine: df<-data.frame(names=c("Bob","Mary","Joe","Bob","Bob")) ggplot(df,aes(names,..density..,group=1))+geom_histogram()+xlim("B

Re: [R] ggplot: Trouble with xlim() and discrete scales

2010-05-10 Thread David Winsemius
On May 10, 2010, at 7:36 PM, John Rauser wrote: I'm learning ggplot and am a little confused. Sometimes discrete scales work like I'd expect, and sometimes they don't. For example... This works exactly like one would expect: df<-data.frame(names=c("Bob","Mary","Joe","Bob","Bob")) ggplot(df

[R] ggplot: Trouble with xlim() and discrete scales

2010-05-10 Thread John Rauser
I'm learning ggplot and am a little confused. Sometimes discrete scales work like I'd expect, and sometimes they don't. For example... This works exactly like one would expect: df<-data.frame(names=c("Bob","Mary","Joe","Bob","Bob")) ggplot(df,aes(names))+geom_histogram() But this yields an erro