Closed ekstroem closed 7 years ago
If you set type
to outer
it should work:
mytheme <- define_palette(
swatch = c('black', 'red', 'green', 'blue', 'brown', 'purple', 'yellow'),
gradient = c(lower = 'red', upper = 'green'),
background = "transparent",
text = c("#444444", "#444444"),
line = c("#6e6e6e", "#6e6e6e"),
gridline = "#c3c3c3"
)
ggthemr(mytheme, type = 'outer')
The default for type
is inner
which then always sets the plot.background
to white. But if type
is set to outer
, plot.background
shares the same colour as panel.background
(i.e. transparent in this case).
That isn't obvious at all sorry, but I'd never actually considered transparent backgrounds. I should probably change it so that it checks for the special case of background
being transparent
, and then ignore the type
parameter.
I'll close this but let me know if that doesn't work for whatever reason.
I'm trying to create a custom theme that can be used with
ggthemr
. Is it possible to set transparent colours - in particular for the background. I tried somthing along the following lines, buttransparent
is not a known R colour.In
ggplot
it is possible to set the background using, say, something along the following linesThanks for a wonderful package!