Skip to content

theme_sg changes subsequent charts without theme #14

@alice-hannah

Description

@alice-hannah

I found when saving the theme_sg() created charts to a file, the font size came out very small. This may be a feature rather than a bug, and either way can be addressed by manually setting the font size.

However, in experimenting, I discovered that creating a chart using theme_sg() results in changes to charts created later without using theme_sg().

This, I assume, is not intended behaviour. Here is a reproducible example:

library(tidyverse)

data = tibble(x = 1:6, y = 2*x)

# with theme_light
data %>% ggplot(aes(x, y)) + geom_point() + theme_light()
ggsave("./test_light1.png", width = 15, height = 7.5, units = "cm")

# with theme_sg
data %>% ggplot(aes(x, y)) + geom_point() + sgplot::theme_sg()
ggsave("./test_sg.png", width = 15, height = 7.5, units = "cm")

# with theme_light
data %>% ggplot(aes(x, y)) + geom_point() + theme_light()
ggsave("./test_light2.png", width = 15, height = 7.5, units = "cm")

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions