Basic: Getting text outside of a legend.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Basic: Getting text outside of a legend.

Mrowley
Hi Everyone,

I'm trying to put text outside of a graphical legend using lattice, but it's proving a pain. It's a scatterplot that is sorted along a colour scale by another variable. The legend appears fine, but unfortunately it doesn't have a text label. I've tried Mtext, panel.text which only puts the text within the panel and everywhere I try and put label or text within the legend code doesn't seem to work.

Could anyone please help?

Kind regards,

Mike

 xyplot(calcona$Mid.depth ~ calcona$bits,
        data=calcona, groups = color, col="black",
        panel = function (x, y, groups, ..., subscripts)
        {
          fill<-groups[subscripts]
          panel.grid(h=-1, v=-1)
          panel.xyplot(x, y, pch=21, fill=fill, ...)
        },
        legend=
          list(right= #I believe the text needs to go here somewhere.
                 list(fun=draw.colorkey,
                      args=list(key=list(col=heat.colors,
                                         at = caex.breaks),
                                draw=FALSE))),
        ylim=(rev(range(0:100))),
        xlim = range(0:7), ylab = "Depth (cm)",
        xlab = "SEM (%)",
        main = list( label =
                       "SEM", cex=1))

Where I would like to put text
Loading...