Skip to content

legend()

1 message · Jim Lemon

#
Jon,

It's fairly easy to get empty boxes and only some lines, e.g.
-1),
+ fill = c("white","white","white", "gray"))

If you really want to get box or line only, try replacing line 133 in
the function 'legend' with the following:

        for (boxcount in 1:length(xt)) {
            if (is.numeric(fill[boxcount]))
                dobox <- !is.na(fill[boxcount])
            if (is.character(fill[boxcount]))
                dobox <- nchar(fill[boxcount])
            if (dobox)
                rect2(xt[boxcount], yt[boxcount] + ybox/2, dx = xbox,
                  dy = ybox/2, col = fill[boxcount])
        }

Not very elegant, but it does the job.

Jim

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._