【问题标题】:I cannot save correctly plots from R我无法从 R 中正确保存图
【发布时间】:2020-02-11 02:23:37
【问题描述】:

我使用 boxplot 在 r 上创建了一个箱线图。

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

然后我将它保存为图像和 pdf,但生成的文件被截断。我报告一个例子

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

【问题讨论】:

    标签: r plot boxplot


    【解决方案1】:

    您需要在保存绘图之前增加边距。您可以使用par() 中的mar 更改边距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()
    

    【讨论】:

      猜你喜欢
      • 2012-09-02
      • 1970-01-01
      • 1970-01-01
      • 2014-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多