Skip to content

Commit

Permalink
Update subtitle margins
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhodge931 committed Sep 19, 2023
1 parent ed53385 commit fd90664
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion R/dark_mode.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ dark_mode <- function (
subtitle_pal = NULL,
subtitle_size = NULL,
subtitle_vjust = 1,
subtitle_margin = ggplot2::margin(t = base_size * -1, b = base_size * 2),
subtitle_margin = ggplot2::margin(t = base_size * -1, b = base_size + 10),
caption_family = NULL,
caption_face = NULL,
caption_alpha = 0.33,
Expand Down
2 changes: 1 addition & 1 deletion R/light_mode.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ light_mode <- function (
subtitle_pal = NULL,
subtitle_size = NULL,
subtitle_vjust = 1,
subtitle_margin = ggplot2::margin(t = base_size * -1, b = base_size * 2),
subtitle_margin = ggplot2::margin(t = base_size * -1, b = base_size + 10),
caption_family = NULL,
caption_face = NULL,
caption_alpha = 0.33,
Expand Down
2 changes: 1 addition & 1 deletion man/dark_mode.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/light_mode.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions vignettes/ggblanket.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ p2 <- penguins2 |>
p1 / p2
```

```{r, fig.asp=1}
```{r, fig.asp=1.05}
# ggblanket
p1 <- penguins2 |>
gg_point(
Expand All @@ -110,7 +110,7 @@ p1 / p2

The `pal` argument is used to customise the colours of the geom. A user can provide a vector of colours to this argument. It can be named or not. It works in a consistent way - regardless of whether a `col` argument is added or not. A named palette can be used to make individual colours stick to particular values.

```{r, fig.asp=0.8}
```{r, fig.asp=0.85}
# ggplot2
p1 <- penguins2 |>
ggplot() +
Expand All @@ -127,7 +127,7 @@ p2 <- penguins2 |>
p1 / p2
```

```{r, fig.asp=0.9}
```{r, fig.asp=0.95}
# ggblanket
p1 <- penguins2 |>
gg_histogram(
Expand Down Expand Up @@ -196,7 +196,7 @@ Prefixed arguments are available to customise titles, scales, guides, and faceti
knitr::include_graphics("screenshot_autotab_y.png", dpi = 300)
```

```{r, fig.asp=0.55}
```{r, fig.asp=0.6}
# ggplot2
penguins2 |>
ggplot() +
Expand Down Expand Up @@ -238,7 +238,7 @@ penguins2 |>

Unspecified x/y/col titles are converted to sentence case with snakecase::to_sentence. All titles can be manually changed using the `*_title` arguments. The default conversion is intended to make titles sometimes able to be left as is.

```{r, fig.asp=0.5}
```{r, fig.asp=0.525}
# ggplot2
penguins2 |>
ggplot() +
Expand Down Expand Up @@ -269,7 +269,7 @@ Note that the `gg_*` function will control what gridlines are present and the pl

Note that `theme_set(theme_grey())` resets the set theme for ggplot2 code to theme_grey and for ggblanket `gg_*` functions to `light_mode()`. If you want ggblanket `gg_*` functions to default to using `theme_grey()`, then you must modify the base_size slightly (e.g. `theme_set(theme_grey(11.01))`).

```{r, fig.asp=0.7}
```{r, fig.asp=0.66}
# ggblanket
theme_set(dark_mode())
Expand All @@ -286,7 +286,7 @@ penguins2 |>

```{r, fig.asp=0.8}
# ggblanket
theme_set(light_mode(base_size = 12))
theme_set(light_mode(base_size = 14))
penguins2 |>
gg_point(
Expand Down Expand Up @@ -316,7 +316,7 @@ Note this symmetry approach does _not_ apply:
* if a transformation other than identity or reverse is applied to x or y scales.
* for `gg_raster`, `gg_contour_filled` or `gg_density_2d_filled`

```{r, fig.asp=0.6}
```{r, fig.asp=0.55}
# ggplot2
penguins2 |>
group_by(species, sex) |>
Expand Down

0 comments on commit fd90664

Please sign in to comment.