e.g.:
barplot(x,col=c("lightgrey","darkgrey"),besid=T)
legend("topleft",c("left","right"),fill=c("lightgrey","darkgrey"))

try:
?legend
and
example(legend)
for documentation!!!

Ingmar Visser schrieb:
> Thanks, this could work!
> However, the legend does not reproduce the color/shading used in the
> original 
> barplot, are those available somehow?
> Best, Ingmar
>
>
> From: David Hajage <[EMAIL PROTECTED]>
> Date: Fri, 13 Oct 2006 14:11:21 +0200
> To: Ingmar Visser <[EMAIL PROTECTED]>
> Cc: <[email protected]>
> Subject: Re: [R] Barplot legend position
>
> For example :
>
> x=matrix(1:10,2,5)
> barplot(x,besid=T)
> legend("topleft", c("left","right"), density= c(0,1000))
>

______________________________________________
[email protected] 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