question facet_wrap versus coord_cartesian

170 views
Skip to first unread message

wolfgang.trutschnig

unread,
Feb 12, 2009, 6:41:10 AM2/12/09
to ggplot2
Dear all !

My question can most easily be understood by the following example:

DM<-diamonds
p<-ggplot(mapping=aes(x = carat, y = price))
p<- p + coord_cartesian(xlim=NULL, ylim=c(0,5000))
p<-p+geom_point(data=DM )
p<-p+facet_wrap(~ cut,ncol=2)
p

In other words: I want to zoom on (but not filter) a part of the given
data (ylim=c(0,5000)) and afterwards use this zoom for the facet_wrap
which however produces the above result.
Since with facet_grid instead of facet_wrap it works perfectly my
question is if this is a bug or what can be done to make the
coordinate-settings also work in the facet_grid.

Thanks in advance and best regards

Wolfgang

hadley wickham

unread,
Feb 12, 2009, 10:17:46 PM2/12/09
to wolfgang.trutschnig, ggplot2
Hi Wolfgang,

Oops - that's a bug. I'll add it to my to do list.

Hadley
--
http://had.co.nz/

Dave Rockoff

unread,
Apr 1, 2009, 12:02:21 PM4/1/09
to ggplot2
Hi Hadley et al,

I am a relative newbie to ggplot2. I was having the same problem but
this clears that up.
But now my y-axis labels and tickmarks disappear; is there a way to
force them to certain values?

Thanks!
Dave Rockoff

droc...@iastate.edu

hadley wickham

unread,
Apr 1, 2009, 8:55:47 PM4/1/09
to Dave Rockoff, ggplot2
Hi Dave,

It should be fixed in the next version, which I'm trying to release soon.

Hadley
--
http://had.co.nz/
Reply all
Reply to author
Forward
0 new messages