Sarah Vandome wrote:
Hello,

I am just starting out using R on my Uni course. I have been given a function 
to work with that adds error bars to a bar chart. I want to add a legend and 
have been trying to amend the code in the function error.bars (see below) so it 
automatically places a legend on the chart. It does this, but the legend is 
sitting over the top of one of my data columns. I need the function to decide 
where best to place the legend, depending on where the chart bar data and error 
bars are located. Is it possible to do this?

Hi Sarah,
The "emptyspace" function in the plotrix package can find the empty space on a bar chart, but would need a little modification to avoid error bars. You could feed it the bar heights plus the error bars, but that might not be automatic enough.

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.

Reply via email to