Stewart Wiseman
Stewart Wiseman

Reputation: 705

Multipanel plot - how to omit a graphy from a specific position in a matrix layout

I cannot get the layout command to work. I want a multi-panel plot with a gap in a specific position, as given by this matrix:

mat <- matrix (c(1,2,3,4,5,6,7,8,9,10,0,12), 4, 3)
mat

where value 0 represents where I need empty space. However I get an error message when I run

 layout(mat)

Using the following does not work either

 mat <- matrix (c(1,1,1,1,1,1,1,1,1,1,0,1), 4, 3)

because when I run

  layout.show(12)

it only gives me one panel instead of a 3x4 matrix layout. Where am I going wrong?

Thanks!

Upvotes: 1

Views: 32

Answers (1)

John Paul
John Paul

Reputation: 12664

The issue is that you have a number 12 panel, but no number 11. Try this instead

mat <- matrix (c(1,2,3,4,5,6,7,8,9,10,0,11), 4, 3) 
layout(mat)
layout.show(11)

enter image description here

Upvotes: 2

Related Questions