Search code examples
rkeywidthlattice

How do you change the width of columns in a Key in a lattice graph?


When I add a key to my xyplot (fore example:

key=list(space='top', columns=2,rows=2, text=list(c('A','B','C','D')),rectangles=list(col=c('black','green','red','blue'),size=2)

It creates columns that are separated by white space.

How do I control (i.e. shrink) this white space?

I've looked meticulously through the par.settings and have found nothing that works.


Solution

  • Though trellis options are often numerous and difficult to read through, this question has an easy solution that was simply overlooked by the OP (me). As @Josh O'Brien's comment above demonstrates, between.columns under key in ?xyplot will take care of the white space between key columns.