[R] Ploting NA location points
Martin Maechler
maechler at stat.math.ethz.ch
Tue Sep 5 13:27:13 CEST 2000
>>>>> "Trent" == Trent Piepho <xyzzy at speakeasy.org> writes:
...
Trent> plot(x,y, pch=21, bg=c(4,2)[is.na(z)+1])
Trent> You need to use a point type from 21 to 25 for the background
Trent> color to show up.
........
Trent> To go along with the plot, I suggest something like:
Trent> legend(0,0, c("Non-Missing", "Missing"), fill=c(4,2))
Trent> The legend will have square boxes of color instead of filled
Trent> circles like pch=21,bg=c(...) will give you. I haven't been
Trent> able to figure out how to get a color filled symbol in a plot
Trent> legend. The bg parameter will apply to the background of the
Trent> entire legend, and not the plotting symbols.
yes.
and I took your notice above as a feature request.
It needs (yet) another argument to legend(.), such as
pt.bg
or point.bg
or points.bg
or pch.bg
(not starting with "bg" to avoid misunderstandings with existing argument bg)
I propose to use the first one ..
(and am about to commit that for R-devel aka "R 1.2 to be").
Opinions?
Martin Maechler <maechler at stat.math.ethz.ch> http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum LEO D10 Leonhardstr. 27
ETH (Federal Inst. Technology) 8092 Zurich SWITZERLAND
phone: x-41-1-632-3408 fax: ...-1228 <><
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list