【问题标题】:Increase the space between x.axis and x.lab in R plot增加 R 图中 x.axis 和 x.lab 之间的空间
【发布时间】:2014-02-27 22:33:09
【问题描述】:

我想在 R 中创建一个绘图,我正在使用编写以下代码,但是如何增加 xlab 和 xaxis 之间的空间,也适用于 R 中的 ylab 和 yaxis?

    op = par(no.readonly = TRUE)
    par(mfrow=c(2, 4))
    par(mar=c(2.5,3.5, 1, .5))
    par(mgp = c(1.5, .5, 0))
    par(oma = c(0, 0, 0, 0))
    plot(x,y,type="l",col="red", cex=1.5, cex.axis=1.5, cex.lab =1.5)
    plot(x,y,type="l",col="red", cex=1.5, cex.axis=1.5, cex.lab =1.5)    
    plot(x,y,type="l",col="red", cex=1.5, cex.axis=1.5, cex.lab =1.5)
    plot(x,y,type="l",col="red", cex=1.5, cex.axis=1.5, cex.lab =1.5)
    plot(x,y,type="l",col="red", cex=1.5, cex.axis=1.5, cex.lab =1.5)
    plot(x,y,type="l",col="red", cex=1.5, cex.axis=1.5, cex.lab =1.5)
    plot(x,y,type="l",col="red", cex=1.5, cex.axis=1.5, cex.lab =1.5)
    plot(x,y,type="l",col="red", cex=1.5, cex.axis=1.5, cex.lab =1.5)

【问题讨论】:

    标签: r


    【解决方案1】:

    在调用plot 之后,您可以在title 中使用line 参数。例如,

    plot(x, y, ...)
    title(xlab = "x label", line = 4)
    

    【讨论】: