Skip to content

theme_af() does not inherit base_size from use_afcharts() #51

@fingertipsy

Description

@fingertipsy

When proving style defaults in use_afcharts(), such as use_afcharts(base_size = 40), I would expect that after calling this function all ggplot objects inherit those styles.

Normally this is the case, for example:

use_afcharts(base_size = 40)

gapminder |>
filter(country %in% c("United Kingdom", "China")) |>
ggplot(aes(x = year, y = lifeExp, colour = country)) +
geom_line(linewidth = 1)

Image

However, it is not the case if the ggplot has an af_theme() layer, for example:

use_afcharts(base_size = 40)

gapminder |>
filter(country %in% c("United Kingdom", "China")) |>
ggplot(aes(x = year, y = lifeExp, colour = country)) +
geom_line(linewidth = 1) +
theme_af(legend = "bottom")

Image

If there is an af_theme() layer, the base_size style set in use_afcharts() is overwritten. Is this intended behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions