I'm trying to save a boxplot with ggplot in R with particular major and minor grid line sizes. If I save as a pdf or png I have no problem but when saving to svg (which I need to do in this case) the sizes of the lines are not saved. Please let me know what other information I might need to provide (Dammit Jim, I'm a biologist, not a computer scientist). Thank you for any help you can offer.
Strains <- c("samp1","samp1","samp1","samp2","samp2","samp2","samp3","samp3","samp3","samp4","samp4","samp4","samp5","samp5","samp5","samp6","samp6","samp6")
value <- c(0.14,0.053,0.26,0.13,0.019,0.43,0.05,0.02,0.14,0.04,0.01,0.06,2.51,2.09,4.41,0.39,0.03,0.41)
sub_plot <- data.frame(Strains, value)
ggplot(sub_plot, aes(Strains, value)) +
geom_boxplot() +
geom_dotplot(binaxis='y', stackdir='center', dotsize=0.5) +
theme_bw(base_size = 16)+ theme(axis.text.x = element_text(size=18,angle=90)) +
theme(panel.grid.major.y = element_line(size = 1.5), panel.grid.minor.y = element_line(size = 0.5))
ggsave(paste("test.svg"))
I want it to look like this: png image
But when I save it as an svg it looks like this: svg image