I am currently on R 3.5.3 and my os is osx mojave. When I save a histogram in R using the ggsave-function, I get these very fine vertically oriented white lines. They don't show up in my R-Viewer but only in preview and vs code (and probably other viewers). Please see the screenshot below. A reproducible example would be the following.
library(dplyr)
library(ggsave)
df <- data.frame(values = sample (c(1:20), size = 1000, replace = T))
histogram <- df %>%
ggplot(aes(x = values)) +
geom_histogram(aes(y=..density..), alpha = 0.7, position = "identity", binwidth = 1, size = 0) +
theme_minimal()
ggsave(histogram, file = "histogram.pdf")
Is there a way to change this behavior? After saving the figure, I would like to insert it into LaTex and make sure these white lines are gone.
