Re: [R] Legend in plot: symbol for mean and standard deviation

About this list Date view Thread view Subject view Author view Attachment view

From: Anne York (york@noaa.gov)
Date: Wed 26 Feb 2003 - 03:10:32 EST


Message-id: <Pine.GSO.4.05.10302250807430.2471-100000@ofis450a.akctr.noaa.gov>

You can specify that no plot character is drawn using pch = -1.

Maybe this is what you want:

plot(1:10,1:10)
legend(locator(1),c("blah","blahblah","blahblahblah","blah..."),
 pch = c(-1,-1,22,22),lty=c(1,1,0,0),col=c("green","red","blue","blue"),
 pt.bg=c("white","white","yellow","orange"))
 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Anne E. York
National Marine Mammal Laboratory
Seattle WA 98115-0070 USA
e-mail: anne.york@noaa.gov
Voice: +1 206-526-4039
Fax: +1 206-526-6615
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Date: Mon, 24 Feb 2003 18:51:35 +0100
From: Uwe Ligges <ligges@statistik.uni-dortmund.de>
To: Marco Kienzle <m.kienzle@marlab.ac.uk>
CC: r-help@stat.math.ethz.ch
Subject: Re: [R] Legend in plot: symbol for mean and standard deviation

Marco Kienzle wrote:
>
> Dear list,
>
> I am facing the following problem with the legend of a plot that display
> the mean and variance of a measurement y as a function of x, the mean
> being represented by a dot and the variance by a vertical line.

At least for me the latter does not appear to be "that common" ...

> My problem is that I am unable to display the symbol (dot + vertical
> line) in the legend.
>
> any help is welcome,
> thanks
> marco

Does the following do what you are looking for?

  legend(..., c("y.", "y|"))
or
  legend(..., expression(y[.], y["|"]))

Uwe Ligges

______________________________________________
R-help@stat.math.ethz.ch mailing list
http://www.stat.math.ethz.ch/mailman/listinfo/r-help


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Tue 01 Jul 2003 - 09:11:23 EST