Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

theme_sg changes subsequent charts without theme #14

Closed
alice-hannah opened this issue Mar 10, 2023 · 2 comments
Closed

theme_sg changes subsequent charts without theme #14

alice-hannah opened this issue Mar 10, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@alice-hannah
Copy link
Member

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")
@alice-hannah alice-hannah added the bug Something isn't working label Mar 10, 2023
@alice-hannah alice-hannah self-assigned this Mar 10, 2023
@alice-hannah
Copy link
Member Author

Related to yixuan/showtext#51?

@alice-hannah
Copy link
Member Author

This issue was caused by use of showtext. This has been removed from sgplot for now. Will investigate other methods of using Google font in theme for future release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant