Skip to content

Make legend.box.background work for theme_void() #2725

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

Merged
merged 3 commits into from
Jul 9, 2018

Conversation

clauswilke
Copy link
Member

Closes issue #2723.

One thing I wasn't sure about was whether I should add all the missing legend theme parameters in theme_void(). There are more than just legend.box. I tried copying them over from theme_grey() but that caused changed spacing in two visual tests so I reverted.

@@ -263,7 +263,7 @@ guides_build <- function(ggrobs, theme) {
# add space between the guide-boxes
guides <- gtable_add_col_space(guides, theme$legend.spacing.x)

} else if (theme$legend.box == "vertical") {
} else { # theme$legend.box == "vertical"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you change the test in the first block to use identical()? That's safer if theme$legend.box is somehow not a length-1 vector. (I'm surprised the user of NULL doesn't cause a warning, TBH)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@clauswilke clauswilke merged commit 3129bf8 into tidyverse:master Jul 9, 2018
@clauswilke clauswilke deleted the issue-2723-legend.box branch July 9, 2018 15:36
@lock
Copy link

lock bot commented Jan 5, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Jan 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants