[R] filled plot symbols

ben@zoo.ufl.edu ben at zoo.ufl.edu
Tue Oct 17 17:40:03 CEST 2000


  That's probably because the point-drawing stuff in legend() comes before
the line-drawing stuff, which means that the lines overwrite the points.
If you want to hack it yourself, just make your own copy of legend() and
switch the order of the "if (has.pch)" block (which draws points) and the
"if (do.lines)" block (which draws the lines).

  As for the wider question of why there are two different kinds of
points, etc., etc. -- I think this is basically historical, and makes more
sense if you think about the R graphics model, which is just objects drawn
onto a canvas. pch=1 doesn't fill in the symbol with any color at all,
while pch=16 fills it in.  If you want quick access to filled and unfilled
symbols, having pch 1 and 16 (and all their neighbors) is easier than
fussing with background colors.  I don't know how hard it would be to make
a point type, or a graphics option, that automatically filled points in
with the plot's background color.

  I don't know, maybe that's obvious.  Probably the background-setting
trick should go in a FAQ, though -- hasn't it come up before?
  
  

On Tue, 17 Oct 2000, Bill Simpson wrote:

> I forgot to mention that the bg="white" trick works on the plot (making
> the empty symbols opaque), but it does NOT work in the legend.
> 
> Bill
> 
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 
> 

-- 
318 Carr Hall                                bolker at zoo.ufl.edu
Zoology Department, University of Florida    http://www.zoo.ufl.edu/bolker
Box 118525                                   (ph)  352-392-5697
Gainesville, FL 32611-8525                   (fax) 352-392-3704

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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