[R] Alignment and Labeling of a color key in a xyplot?

Hofert Marius m_hofert at web.de
Tue Jan 1 12:36:49 CET 2008

Happy New Year to all R users!

I have two short questions concerning a xyplot with a color key:

1) How do I properly place (align) the color key beside the xyplot?
As you can see from the code listed below, the placement of the color  
key is not correct. I would like the upper and lower end point of the  
color key to be perfectly aligned with the upper and lower line of  
the xyplot. Adjusting the viewport-arguments below is tedious and  
also does not help if you want the print the plot in a postscript  
file (see the commented lines below).

2) How do I put a label on the color key?
I would like to give the color key a label as the label 'x' for the y- 
axis, so it should be vertically printed and located to the right of  
the color key. I tried to give the 'key' argument in 'draw.colorkey'  
some arguments, but I could not manage to put a label on the color key.

Thanks very much.



More information about the R-help mailing list