Skip to content

Lattice xyplot: Line and Rectangle in legend.

2 messages · jimdare, Deepayan Sarkar

#
Hello fellow R users,

I have a problem.  I have created a barchart overlayed by an xyplot line,
both of which read off the same Y axis.  The problem comes when I try to
generate a key.  It seems that I can only create either two lines, or two
rectangles.  I would much prefer to have the barchat series depicted by a
rectangle, and the xyplot series by a line.  Is there a way to do this? 
Your help is much appreciated.

James
#
On Tue, Apr 14, 2009 at 4:39 PM, jimdare <jamesdare26 at gmail.com> wrote:
Something like

xyplot(1 ~ 1, key = list(text = list("line"), lines = list(col = 2),
text = list("rect"), rect = list(col = "yellow")))

?

-Deepayan