Skip to content

Force fill of panel.border to be transparent #5782

Closed
@teunbrand

Description

@teunbrand

This plot is useless, as all data is obfuscated by the panel.border rectangle.

library(ggplot2)

ggplot(mpg, aes(displ, hwy)) +
  geom_point() +
  theme(panel.border = element_rect())

Created on 2024-03-19 with reprex v2.1.0

It has a white fill because it inherits from the theme's root rect setting. This issue is easy to rectify by setting element_rect(fill = NA) (why yes, I am indeed pleased by this choice of words). I cannot imagine the plot above to be the desired outcome of any plot, so this feature request is to force the fill to be transparent, regardless of input.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions