[R] fill prob. in legend

Jerome Asselin jerome at hivnet.ubc.ca
Mon Feb 24 19:49:03 CET 2003


Ok... All we need is an "blank" symbol (such as pch=30(?)).

Now try again...

Jerome

plot(0,0)
legend(0,0,c("blah","blahblah","blahblahblah","blah..."),
pch=c(30,30,22,22),
col=c("green","red","blue","blue"),
lty=c(1,1,2,2),
pt.bg=c("white","white","yellow","orange"),cex=2)

On Monday 24 February 2003 10:34, Uwe Ligges wrote:
> Content-Length: 1182
> Status: R
> X-Status: N
>
> Jerome Asselin wrote:
> > I think this does what you want...
> >
> > Jerome
> >
> > plot(0,0)
> > legend(0,0,c("blah","blahblah","blahblahblah","blah..."),
> > pch=c(21,21,22,22),
> > col=c("green","red","blue","blue"),
> > pt.bg=c("white","white","yellow","orange"),cex=2)
>
> I don't think so, because Jeremy Butler asked for *lines*.
> Unfortunately, the my answer won't be much more helpful (see below).
>
> > On Sunday 23 February 2003 17:29, Jeremy Z Butler wrote:
> > > Hi,
> > > I'm trying to construct a legend which has four lines of text and
> > > associated symbols. The first two symbols need to be normal lines which
> > > vary only in colour. The second two symbols should have filled boxes.
> > > How do I suppress the fill boxes in the first two lines?
> > > J.
>
> Well, you cannot, AFAIK.
> You have to construct such a special legend using either two tricky
> calls to legend, or add the elements with low level functions like
> text() and friends to the plot.
> I think a contribution of an improvement of legend() that solves your
> problem is welcome.
>
> Uwe Ligges
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> http://www.stat.math.ethz.ch/mailman/listinfo/r-help

-- 

Jerome Asselin (Jérôme)
Statistical Analyst
British Columbia Centre for Excellence in HIV/AIDS
St. Paul's Hospital
608 - 1081 Burrard Street
Vancouver, British Columbia
CANADA V6Z 1Y6

Email: jerome at hivnet.ubc.ca
Phone: 604 806-9112   Fax: 604 806-9044




More information about the R-help mailing list