Skip to content
Prev 247032 / 398506 Next

Rectangle height in lattice xyplot key

Hi Deepayan

Thank you very much for the update to lattice and the solution.

For the current problem the texts are all single lines and the solution 
works well.
The example was to accentuate the problem and I thought that it would be 
useful in the future.
I was able to make all the heights look equal in the example by creating a 
vector and reducing the height of the 2-lined rows.

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 = c(0.7,0.45,0.7,0.7,0.45),
                                     border = FALSE)) )


Regards

Duncan
At 17:14 11/01/2011, you wrote: