Skip to content

theme_void() does not remove grids #2079

Closed

Description

@basille

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

Activity

  1. added a commit that references this issue on Mar 20, 2017
    977e051
  2. added
    bug
    on Jun 12, 2017
  3. added a commit that references this issue on Jul 3, 2017
    6dd2836
  4. added a commit that references this issue on Jul 14, 2017
    0c02a27
  5. added a commit that references this issue on Aug 1, 2017
    a4184d5
  6. locked as resolved and limited conversation to collaborators on Jun 18, 2018
  7. added a commit that references this issue on Apr 1, 2026
    6770641
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugthemes 💃

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions