Skip to content

Instantly share code, notes, and snippets.

@kohske
Created May 23, 2011 23:25
Show Gist options
  • Save kohske/987847 to your computer and use it in GitHub Desktop.
Save kohske/987847 to your computer and use it in GitHub Desktop.
example for feature/coord-manual-lim in ggplot2
lims <- data.frame(vs=c(0,0,1,1), am=c(0,1,0,1),
xmin=c(6,2,2,2), xmax=c(10,10,6,4), ymin=c(10,15,17,21),ymax=c(20,26,25,34))
#ggplot(mtcars, aes(cyl, mpg)) + geom_point() +
# facet_grid(~vs+am, scale="free", lims=lims) # does not work with facet_grid
ggplot(mtcars, aes(cyl, mpg)) + geom_point() +
facet_wrap(~vs+am, scale="free", coord.limits=lims) + coord_cartesian(wise=T) # please try also wise=F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment