1

For my purposes, I only need to use a matrix layout (not mfrow, or split.screen).

I was wondering in a 7 x 4 layout for 28 ordered plots how could I minimize (I will not need any axes or axes labels, only the frame is enough) all the possible spaces between the 28 plots?

m = matrix(c(1:7, 8:14, 15:21, 22:28), nrow = 7); layout(m)
par(mar = c(1, 1, 1, 1))

lapply(1:28, plot, t = "n")

enter image description here

rnorouzian
  • 7,397
  • 5
  • 27
  • 72

1 Answers1

0

How about this solution

m = matrix(c(1:7, 8:14, 15:21, 22:28), nrow = 7);
layout(m)
par(mar = c(0.1, 0.1,0.1,0.1), oma=c(1,1,1,1))
lapply(1:28, plot, t = "n", xaxt="n", yaxt="n")

Play around with the margins a bit: c(0.1, 0.1,0.1,0.1) and increase/decrease values. the parameters xaxt and yaxt="n" suppress the axis ticks. oma is for the outer margins and adds space around the entire "frame".

Jan
  • 3,825
  • 3
  • 31
  • 51
  • look for nested plots. like (here)[https://stackoverflow.com/questions/20817557/nested-plots-in-r] or (perhaps here)[https://stackoverflow.com/questions/27015449/nested-layouts-in-r] – Jan Jun 29 '17 at 06:04
  • sry, misread that. answer is updated. oma is the parameter that works – Jan Jun 29 '17 at 06:18