I'm trying to plot a legend at the bottom of a main plot area comprised of multiple small plots (4 rows x 5 columns). I figured out how to center the legend at the bottom with the aid of this answer. I'm interested in having a horizontal legend, so I tried to use legend(x="center",lbls, horiz=TRUE)
, which would have served my purposes - except that my labels are too long and it goes off the plot area. I decided that a 2 row x 4 column layout will work best (I have 8 labels).
However, legend(x="center",lbls, ncol = 4)
fills in the columns first (i.e. top to bottom), and I'd like to fill in by row first (i.e. left to right). Is there a workaround for this that doesn't involve using multiple legends?