Mapping in consistent place

Fixes #246
This commit is contained in:
hadley 2016-08-12 12:36:32 -05:00
parent 8a43da7124
commit 2d0771ccd9
1 changed files with 2 additions and 2 deletions

View File

@ -236,8 +236,8 @@ One way to add additional variables is with aesthetics. Another way, particularl
To facet your plot by a single variable, use `facet_wrap()`. The first argument of `facet_wrap()` should be a formula, which you create with `~` followed by a variable name (here "formula" is the name of a data structure in R, not a synonym for "equation"). The variable that you pass to `facet_wrap()` should be discrete. To facet your plot by a single variable, use `facet_wrap()`. The first argument of `facet_wrap()` should be a formula, which you create with `~` followed by a variable name (here "formula" is the name of a data structure in R, not a synonym for "equation"). The variable that you pass to `facet_wrap()` should be discrete.
```{r} ```{r}
ggplot(data = mpg, mapping = aes(x = displ, y = hwy)) + ggplot(data = mpg) +
geom_point() + geom_point(mapping = aes(x = displ, y = hwy)) +
facet_wrap(~ class, nrow = 2) facet_wrap(~ class, nrow = 2)
``` ```