ggthemes icon indicating copy to clipboard operation
ggthemes copied to clipboard

base_family not working in theme_economist() and theme_excel()

Open adrgru opened this issue 2 years ago • 0 comments

I'm not sure if this only is a problem on my end: I have extrafont installed, and I have all my fonts imported into R. I'm using the latest version, 4.2.4, installed today from GitHub. I was using the CRAN version earlier and ran into the same issue.

I can successfully change the font family for all but three options: theme_economist, theme_economist_white, and theme_excel. I had originally only tried changing the font in theme_economist since it explicitly points out The Economist's use of another font. I was sure that I must have imported the fonts incorrectly, but when trying other options, they showed up as expected.

Is there something I did wrong, or is this a bug in the package? Since the code is identical save for a different option, I would have expected similar behaviour.

p2 <- ggplot(mtcars, aes(x = wt, y = mpg, colour = factor(gear))) +
    geom_point() +
    ggtitle("Cars")
p2 + scale_colour_calc() + theme_calc(base_family = "Stencil")
p2 + scale_colour_gdocs() + theme_gdocs(base_family = "Stencil")
p2 + scale_colour_economist() + theme_economist(base_family = "Stencil")
p2 + scale_colour_excel() + theme_excel(base_family = "Stencil")

(Code for p2 taken from Introduction to ggthemes)

calc gdocs economist excel

adrgru avatar Dec 13 '21 12:12 adrgru