Closed
Description
Hi,
I have come across a strange issue with ggsave()
where it does not properly render a line if the y-variable is factored. It looks to me like it is ignoring the factoring, and plotting as if it was unfactored. It looks like this behavior does not occur when factoring the x-variable. When I use graphic devices like png()
I do not have the issue. I did not include ggsave()
or png()
in the reprex because there is nowhere for the files to save, of course, but I have attached the output of each method below it.
library(tidyverse)
mtcars %>%
mutate(mpg = factor(mpg)) %>%
ggplot(aes(disp, mpg)) +
geom_line(group = 1)
Created on 2020-09-19 by the reprex package (v0.3.0)