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

Already on GitHub? Sign in to your account

theme_void() does not remove grids #2079

Open
basille opened this Issue Mar 20, 2017 · 0 comments

Comments

Projects
None yet
2 participants

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).

basille referenced this issue in wilkelab/cowplot Mar 20, 2017

Closed

plot_grid and theme_update(panel.grid.major) #63

@has2k1 has2k1 added a commit to has2k1/ggplot2 that referenced this issue Mar 20, 2017

@has2k1 has2k1 Fix calculation of theme defaults
**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 #2058
Fixes #2079
977e051

@has2k1 has2k1 added a commit to has2k1/ggplot2 that referenced this issue Jul 3, 2017

@has2k1 has2k1 Fix calculation of theme defaults
**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 #2058
Fixes #2079
6dd2836

@has2k1 has2k1 added a commit to has2k1/ggplot2 that referenced this issue Jul 14, 2017

@has2k1 has2k1 Fix calculation of theme defaults
**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 #2058
Fixes #2079
0c02a27

@has2k1 has2k1 added a commit to has2k1/ggplot2 that referenced this issue Aug 1, 2017

@has2k1 has2k1 Fix calculation of theme defaults
**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 #2058
Fixes #2079
a4184d5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment