How to get the desired point size exporting a layout in R?

Viewed 205

I'm exporting my plots from R in .svg format. The journal specifies that all the text within the graphics must be 8pt. When I create a single plot using

svg(filename="Single.svg", pointsize=8)

the text size is perfect, but when I create a layout, the size is smaller. How can I obtain the correct point sizes in the exported layouts?

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

A zoom in the details:

enter image description here

1 Answers

Simply add par(cex = 1) after the layout and before the 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

Related