[R] Adding units to levelplot's colorkey

Deepayan Sarkar deepayan.sarkar at gmail.com
Wed Nov 23 08:20:03 CET 2011

On Tue, Nov 15, 2011 at 6:53 PM, Carlisle Thacker
<Carlisle.Thacker at noaa.gov> wrote:
> Sorry that I was not clear.  I was asking how to add annotation to
> levelplot's colorkey, not the levelplot itself.  The only entry I can
> find from the help pages is via its labels.
> Googling did yield this:  " draw.colorkey() doesn't support a title for
> the legend".  So I presume there is also no support for any other
> annotation.

That is correct. Note that having support for more annotation is not
technically difficult, but it's not clear what a good design would be.

For the purpose you describe, I typically do something like

levelplot(volcano, colorkey = list(space = "top"),
          main = "Height (cm)")

But I don't know how to do this nicely with a vertical color key.


More information about the R-help mailing list