[R] R plot split screen in uneven panels
Luigi Marongiu
m@rongiu@luigi @ending from gm@il@com
Wed Dec 12 16:19:01 CET 2018
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?
> m = matrix(c(0,20,40,0, 20,60,40,0), byrow=T, ncol=4)
> m
[,1] [,2] [,3] [,4]
[1,] 0 20 40 0
[2,] 20 60 40 0
> split.screen(m)
Error in par(split.screens[[cur.screen]]) :
invalid value specified for graphical parameter "fig"
> m[1,]
[1] 0 20 40 0
> split.screen(m[1,])
Error in split.screen(m[1, ]) : 'figs' must specify at least one screen
What should be the syntax for this task?
--
Best regards,
Luigi
More information about the R-help
mailing list