Skip to content

Commit

Permalink
no more expand_scale()
Browse files Browse the repository at this point in the history
  • Loading branch information
clauswilke committed Aug 22, 2020
1 parent b2532b0 commit 1d438f3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions vignettes/aligning_plots.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ p1 <- ggplot(mtcars, aes(disp, mpg)) +
p2 <- ggplot(mtcars, aes(factor(vs))) +
geom_bar() +
facet_wrap(~am) +
scale_y_continuous(expand = expand_scale(mult = c(0, 0.1))) +
scale_y_continuous(expand = expansion(mult = c(0, 0.1))) +
theme_minimal_hgrid(12) +
panel_border(color = "black") +
theme(strip.background = element_rect(fill = "gray80"))
Expand Down Expand Up @@ -126,7 +126,7 @@ city_mpg <- city_mpg %>%
p1 <- ggplot(city_mpg, aes(class, count)) +
geom_col(fill = "#6297E770") +
scale_y_continuous(
expand = expand_scale(mult = c(0, 0.05)),
expand = expansion(mult = c(0, 0.05)),
position = "right"
) +
theme_minimal_hgrid(11, rel_small = 1) +
Expand Down
2 changes: 1 addition & 1 deletion vignettes/drawing_with_on_plots.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ The `draw_plot()` function also allows us to place plots at arbitrary locations
```{r fig.width = 6, fig.height = 4.5}
inset <- ggplot(mpg, aes(drv)) +
geom_bar(fill = "skyblue2", alpha = 0.7) +
scale_y_continuous(expand = expand_scale(mult = c(0, 0.05))) +
scale_y_continuous(expand = expansion(mult = c(0, 0.05))) +
theme_minimal_hgrid(11)
ggdraw(p + theme_half_open(12)) +
Expand Down
2 changes: 1 addition & 1 deletion vignettes/introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
# minimal horizontal grid theme
ggplot(iris, aes(Sepal.Length, fill = Species)) +
geom_density(alpha = 0.5) +
scale_y_continuous(expand = expand_scale(mult = c(0, 0.05))) +
scale_y_continuous(expand = expansion(mult = c(0, 0.05))) +
theme_minimal_hgrid(12)
```

Expand Down
2 changes: 1 addition & 1 deletion vignettes/shared_legends.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ p1 <- ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
# plot 2
p2 <- ggplot(iris, aes(Sepal.Length, fill = Species)) +
geom_density(alpha = .7) +
scale_y_continuous(expand = expand_scale(mult = c(0, 0.05))) +
scale_y_continuous(expand = expansion(mult = c(0, 0.05))) +
theme_half_open(12) +
theme(legend.justification = "top")
p2a <- p2 + theme(legend.position = "none")
Expand Down
2 changes: 1 addition & 1 deletion vignettes/themes.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ p <- ggplot(mtcars, aes(factor(cyl))) +
geom_bar(fill = "#56B4E9", alpha = 0.8) +
scale_y_continuous(
# don't expand y scale at the lower end
expand = expand_scale(mult = c(0, 0.05))
expand = expansion(mult = c(0, 0.05))
)
p + theme_half_open()
Expand Down

0 comments on commit 1d438f3

Please sign in to comment.