When I save a ggplot image with theme_minimal
the black and white values are reversed in a photo negative like effect. This does not occur if I do not use a theme nor does it occur with theme_bw. It also does not occur when saving to .pdf
or .png
. I have tested and this occurs when running in RStudio, R GUI, or through the terminal. I'm running R version 4.0.2 on Mac OS 10.15.7.
I would greatly appreciate any insight into debugging this. The behavior has persisted for several weeks across multiple full system restarts.
library(ggplot2)
ggplot(diamonds, aes(x = cut, y = clarity)) +
geom_point() +
theme_minimal()
ggsave("test_minimal.jpg")
theme(plot.background = element_rect(fill = "white", color = NA))
– Heronrybg="white"
in ggsave is proposed as a workaround. – Heronry