You probably want to use +coord_cartesian(xlim=c(1,5)). There are good examples of this on the ggplot web page.
Ben
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
You probably want to use +coord_cartesian(xlim=c(1,5)).
Hmmm, this is not exactly a bug but it's a rather subtle feature of
discrete scales. The basic problem is that discrete scales also have
a continuous component so that (e.g.) jittering can work. That's what
you're seeing here, since you're really supplying continuous data to a
discrete scale.
> Adding +xlim(55, 70) in the second
> instance brings the two examples into line again. My head hurts :)
Because that's just a shortcut for scale_x_continuous(limits = c(55, 70))
Hadley
--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/