Skip to content
Prev 247014 / 398506 Next

Rectangle height in lattice xyplot key

On Sun, Jan 9, 2011 at 9:31 AM, Duncan Mackay <mackay at northnet.com.au> wrote:
There is now (in the last update of lattice, released last week). So
the following should work:

xyplot(1~1,
       key = list(corner = c(0.8,0.8),
                  cex   = 0.6,
                  title = "Functional Groups",
                  cex.title = 0.7,
                  columns = 1,
                  padding.text = 4,
                  text  = list(label =
c("Tree","Shrub\n(low)","Herb","Grass","Shrub\n(small)")),
                  points = list(pch = c(1,3,4,20,16),
                                col = c(2,3,4,5,6)),
                  lines = list(col = c(2,3,4,5,6),
                               size = 2),
                  rectangles = list(col = c(2,3,4,5,6),
                                    size = 1,
                                    height = 0.7, ## newly added
                                    border = FALSE)) )

Of course 'height' is just a multiplier, so the heights are still not
all the same because of differing row heights, but I assume that's not
going to be a problem in your real example.

-Deepayan