如何在R中导出所需的点大小导出布局?

时间:2017-11-23 17:00:00

标签: r svg layout plot export

我以.svg格式从R导出我的地块。该期刊指定图形中的所有文本必须为8pt。当我使用

创建单个图表时
svg(filename="Single.svg", pointsize=8)

文本大小是完美的,但是当我创建布局时,尺寸更小。如何在导出的布局中获得正确的磅值?

svg(filename="Single.svg",
    width=2,
    height=2,
    pointsize=8)

plot(1:10, xlab = "X axis", ylab = "y axis", las = 1)

dev.off()

svg(filename="LayoutPlot.svg",
    width=4,
    height=4,
    pointsize=8)

layout(matrix(c(1,2,3,4), 2, 2, byrow = T))

plot(1:10, xlab = "X axis", ylab = "y axis", las = 1, col = "red")
plot(1:10, xlab = "X axis", ylab = "y axis", las = 1, col = "red")
plot(1:10, xlab = "X axis", ylab = "y axis", las = 1, col = "red")
plot(1:10, xlab = "X axis", ylab = "y axis", las = 1, col = "red")

dev.off()

enter image description here

放大细节:

enter image description here

1 个答案:

答案 0 :(得分:0)

只需在par(cex = 1)之后和layout

之前添加plot即可
svg(filename="LayoutPlot.svg",
    width=4,
    height=4,
    pointsize=8)

layout(matrix(c(1,2,3,4), 2, 2, byrow = T))

par(cex=1) #<- NEW ADD

plot(1:10, xlab = "X axis", ylab = "y axis", las = 1, col = "red")
plot(1:10, xlab = "X axis", ylab = "y axis", las = 1, col = "red")
plot(1:10, xlab = "X axis", ylab = "y axis", las = 1, col = "red")
plot(1:10, xlab = "X axis", ylab = "y axis", las = 1, col = "red")

dev.off()

enter image description here