我无法正确保存R中的图

时间:2019-10-14 12:45:07

标签: r plot boxplot

我使用boxplot在r上创建了箱形图。

boxplot_nonorm= boxplot(log10(table_tissues_filtered_high+1), 
                        las=2, 
                        main= "Data not normalized",
                        col= "light green", )

然后我将其另存为图像和pdf,但是生成的文件被截断了。我举了一个例子enter image description here

我无法读取标签名称。我该如何解决?

1 个答案:

答案 0 :(得分:0)

在保存图之前,您需要增加边距。您可以使用mar par()

中的c(bottom, left, top, right)更改边距
png(filename="figure.png", width=900, bg="white")
par(mar=c(10,6,4,1))
boxplot(mtcars, names = c(paste0("very_long_label",1:11)), las = 2)
dev.off()