我正在尝试在 R 中使用具有特定主要和次要网格线大小的 ggplot 保存箱线图。如果我保存为 pdf 或 png 我没有问题,但是当保存到 svg 时(在这种情况下我需要这样做),行的大小不会被保存。请让我知道我可能需要提供哪些其他信息(该死的吉姆,我是生物学家,而不是计算机科学家)。感谢您提供的任何帮助。
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"))
我希望它看起来像这样: png 图像
但是当我将它保存为 svg 时,它看起来像这样: svg image