Wrap horizontal legend across multiple rows
问题 Suppose I have data like the following: lab <- "A really really long string!" dat <- data.frame(grp = paste(1:6,lab),x=1:6,y=runif(6)) When plotting a legend with strings this long, sometimes it can be a challenge to get the legend to fit nicely. If I have to I can always abbreviate the strings to shorten them, but I was wondering if it's possible (most likely using some grid magic) to 'wrap' a legend across multiple rows or columns. For instance, say I position the legend on the bottom,