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

notes for future themes chapter PR #262

Open
djnavarro opened this issue Jun 17, 2021 · 0 comments
Open

notes for future themes chapter PR #262

djnavarro opened this issue Jun 17, 2021 · 0 comments

Comments

@djnavarro
Copy link
Collaborator

djnavarro commented Jun 17, 2021

  • Should explain the difference between + and %+replace. Seems to have gone missing in the current version? Possible example:

    base <- ggplot(mpg, aes(displ, hwy)) + geom_point()
    base + theme_dark() + theme(panel.background = element_rect(colour = "black"))
    base + theme_dark() %+replace% theme(panel.background = element_rect(colour = "black"))
    
  • Needs an explicit section on theme inheritance? The intuitive model is to think it works like layers (adds new things) or scales (overrides previous) rather than the actual specificity-based model. The logic of this is stated in the current version but it is buried a little. Compare to https://ggplot2.tidyverse.org/reference/theme.html where inheritance is a top level heading. Among other things it may be worth discussing the element tree in the themes chapter. Something like this:

    element_tree <- get_element_tree()
    element_tree[["title"]]   # the title element does not inherit
    element_tree[["plot.title"]] # the plot.title element inherits from title
    

    It's not super exciting, but I think it will be useful in foreshadowing for the extensions chapter (i.e., it's hard to talk about modifying the element tree in an extension package if we haven't introduced the concept when describing the theming system)

  • Discussion of ggsave() could be expanded? It's an oddly placed section: I almost wonder if there is value in having a short chapter discussing how ggplot objects interact with other systems? It could include saving plots, incorporating ggplot objects in R markdown, metadata (e.g., alt text), graphics devices, recent advances in fonts, etc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants