On 09/02/2010 04:56 AM, josef.kar...@phila.gov wrote:
I have a simple barplot of 4 mean values, each mean value has an
associated 95% confidence interval drawn on the plot as an error bar.
I want to make a legend on the plot that uses the error bar symbol, and
explains "95% C.I."
How do I show the error bar symbol in the legend? I could not find any
"pch" values that are appropriate
Hi Josef,
There is a way to do this, but it is not too easy. First, use the
my.symbols function in the TeachingDemos package to define the "error
bar" symbol. Then, you can draw a legend without one or more symbol
elements and place your "error bar" symbol where the symbol would have
been. You can see how to do this in the code of the legendg function in
the plotrix package by getting the necessary coordinates from the legend
function.
Jim
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.