Marco Kienzle
2003-Feb-24 17:17 UTC
[R] Legend in plot: symbol for mean and standard deviation
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. My problem is that I am unable to display the symbol (dot + vertical line) in the legend. any help is welcome, thanks marco -- ____________________________________________________________________________ Marco Kienzle Fisheries Research Services Marine Laboratory PO Box 101 Victoria Road Aberdeen AB119DB United Kingdom direct: +44 (0) 1224 295421 tel: +44 (0) 1224 876544 fax: +44 (0) 1224 295511 marlab.ac.uk
Uwe Ligges
2003-Feb-24 18:52 UTC
[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 > marcoDoes the following do what you are looking for? legend(..., c("y.", "y|")) or legend(..., expression(y[.], y["|"])) Uwe Ligges
Marco Kienzle
2003-Feb-25 16:51 UTC
[R] Legend in plot: symbol for mean and standard deviation
Dear list, I attached to this mail an eps file containing an example that illustrate the problem: the plot display dot+vertical lines while with the legend I am able only to display dot+horizontal line. Any help is appreciate, cheers, marco On Mon, 2003-02-24 at 17:51, Uwe Ligges wrote:> 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-- ____________________________________________________________________________ Marco Kienzle Fisheries Research Services Marine Laboratory PO Box 101 Victoria Road Aberdeen AB119DB United Kingdom direct: +44 (0) 1224 295421 tel: +44 (0) 1224 876544 fax: +44 (0) 1224 295511 marlab.ac.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: graph.eps Type: application/postscript Size: 4524 bytes Desc: Url : stat.ethz.ch/pipermail/r-help/attachments/20030225/a9e83d0d/graph.eps
Anne York
2003-Feb-25 17:11 UTC
[R] Legend in plot: symbol for mean and standard deviation
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 at 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 at statistik.uni-dortmund.de> To: Marco Kienzle <m.kienzle at marlab.ac.uk> CC: r-help at 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 > marcoDoes the following do what you are looking for? legend(..., c("y.", "y|")) or legend(..., expression(y[.], y["|"])) Uwe Ligges