[R] Barplot legend position

Stefan Grosse singularitaet at gmx.net
Fri Oct 13 16:09:07 CEST 2006


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 <dhajage at gmail.com>
> Date: Fri, 13 Oct 2006 14:11:21 +0200
> To: Ingmar Visser <I.Visser at uva.nl>
> Cc: <R-help at stat.math.ethz.ch>
> 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))
>



More information about the R-help mailing list