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_void() does not remove grids #2079

Closed
basille opened this issue Mar 20, 2017 · 0 comments
Closed

theme_void() does not remove grids #2079

basille opened this issue Mar 20, 2017 · 0 comments

Comments

@basille
Copy link

@basille basille commented Mar 20, 2017

When using a custom grid, theme_void does not remove it. Here is a simple example illustrating it:

library(ggplot2)
qplot(1:10, (1:10)^2)                   # Basic plot
theme_update(panel.grid.major = element_line(colour = "red",
    size = 0.5))                        # I want major grid in red
qplot(1:10, (1:10)^2)                   # Works OK
qplot(1:10, (1:10)^2) + theme_void()    # Grid still here

Given that theme_void is supposed to be a completely empty theme, I think theme_void should redefine all elements to element_blank(), including panel.grid.major and panel.grid.minor, and probably others (I believe it is somehow related to #2058, in the sense that theme_void should redefine more elements than it currently does).

has2k1 added a commit to has2k1/ggplot2 that referenced this issue Mar 20, 2017
**Issue**
At plot time, the calculation of theme elements always fell back
to the default theme. As a consequence, the default theme would
leak into complete themes where some of the elements were
unspecified.

**Solution**
Be more specific when calculating the theme defaults.

**Clean Up**
`theme_void` was insufficiently specified. The solution exposed
missing elements that had to be specified.

Fixes tidyverse#2058
Fixes tidyverse#2079
has2k1 added a commit to has2k1/ggplot2 that referenced this issue Jul 3, 2017
**Issue**
At plot time, the calculation of theme elements always fell back
to the default theme. As a consequence, the default theme would
leak into complete themes where some of the elements were
unspecified.

**Solution**
Be more specific when calculating the theme defaults.

**Clean Up**
`theme_void` was insufficiently specified. The solution exposed
missing elements that had to be specified.

Fixes tidyverse#2058
Fixes tidyverse#2079
has2k1 added a commit to has2k1/ggplot2 that referenced this issue Jul 14, 2017
**Issue**
At plot time, the calculation of theme elements always fell back
to the default theme. As a consequence, the default theme would
leak into complete themes where some of the elements were
unspecified.

**Solution**
Be more specific when calculating the theme defaults.

**Clean Up**
`theme_void` was insufficiently specified. The solution exposed
missing elements that had to be specified.

Fixes tidyverse#2058
Fixes tidyverse#2079
has2k1 added a commit to has2k1/ggplot2 that referenced this issue Aug 1, 2017
**Issue**
At plot time, the calculation of theme elements always fell back
to the default theme. As a consequence, the default theme would
leak into complete themes where some of the elements were
unspecified.

**Solution**
Be more specific when calculating the theme defaults.

**Clean Up**
`theme_void` was insufficiently specified. The solution exposed
missing elements that had to be specified.

Fixes tidyverse#2058
Fixes tidyverse#2079
@hadley hadley closed this in 6770641 Nov 1, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants