Skip to content
Prev 377726 / 398502 Next

R plot split screen in uneven panels

Dear all,
I would like to draw two plots in the same device so that there is a
single row and two columns, with the first column being 1/3 of the
device's width.
I am creating a PNG object with width = 30 and height = 20 cm.
I know that I should use split.screen or layout but I am lost with the
matrix to pass to the functions.
For istance, I tried:
# distance in arbitrary units (so let's say cm) from of corners
# left, right, bottom, and top counting from bottom left corner
# that is first panel has the bottom right corner 20 cm from the bottom left?
[,1] [,2] [,3] [,4]
[1,]    0   20   40    0
[2,]   20   60   40    0
Error in par(split.screens[[cur.screen]]) :
  invalid value specified for graphical parameter "fig"
[1]  0 20 40  0
Error in split.screen(m[1, ]) : 'figs' must specify at least one screen

What should be the syntax for this task?