Skip to content

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

Merged
clauswilke merged 3 commits into
tidyverse:masterfrom
wilkelab:issue-2723-legend.box
Jul 9, 2018
Merged

clauswilke merged 3 commits into
tidyverse:masterfrom
wilkelab:issue-2723-legend.box

Conversation

@clauswilke

Copy link
Copy Markdown
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.

Comment thread R/guides-.r
guides <- gtable_add_col_space(guides, theme$legend.spacing.x)

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

Copy link
Copy Markdown
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
Copy Markdown
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

lock Bot commented Jan 5, 2019

Copy link
Copy Markdown

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