[R] how to add a legend in a barchart
deepayan at stat.wisc.edu
Wed Dec 1 16:26:27 CET 2004
On Wednesday 01 December 2004 05:43, ronggui wrote:
> i use
> #pic 1
> to draw a picture.and i want to add a legend to telling others the
> line vertical is x=6.76.so how should i do? legend does not works.
> thank you .
> i have use help.search("legend") but no result i want.
But have you read help(barchart)? Look for 'legend' and 'key'.
What you want is not exactly standard, but you may be satisfied with
key = list(text = list("6.76"), lines = list(col = "red")))
If not, you can create arbitrary legends using grid.
More information about the R-help