Dear list,

following up on my own post, I have now started trying constructing a
"legend" argument to xyplot that would work, based on the examples in
Sarkar's book.

I'm now at a state where I have a legend that does not throw an error, but
no legend is displayed:


           legend=list(corner=list(
                         fun=draw.key,
                         args=list(
                           key=list(text=
                             list(myFactorLevels),
                             lines=list(
                               lty=1:length(myFactorLevels))
                             ),
                           draw=TRUE
                           )
                         ),x=0,y=1



Where myFactorLevels contains the levels I want displayed (e.i. the levels
of myGroups in my previous attempt).

Please, why is this legend not displayed?

/Fredrik

On Tue, Aug 16, 2011 at 1:05 PM, Fredrik Karlsson <dargosch@gmail.com>wrote:

> Hi,
>
> I would like to add an additional key inside of a panel based on a factor
> that is not the "groups" argument.
> I've tried using the panel.key function in latticeExtras, but I cannot get
> the line types the way I want it.
>
> Using my factor myGroups, I've tried this:
>
> panel.key(text=levels(myGroups),lines=TRUE,points=FALSE,corner =
> c(0,.98),key=list(lines=list(lty=1:length(levels(myGroups)))))
>
> I then get the key where I want it, the text is right, but line types are
> not correct (always lty=1, I think).
>
> Any ideas on how I could solve this?
>
>
>
> /Fredrik
>
>
>
> --
> "Life is like a trumpet - if you don't put anything into it, you don't get
> anything out of it."
>



-- 
"Life is like a trumpet - if you don't put anything into it, you don't get
anything out of it."

	[[alternative HTML version deleted]]

