Dear useRs,
I'm trying to create a barplot like so:
x=matrix(1:10,2,5)
barplot(x,leg=c("left","right"),besid=T)
The legend is placed in default position topright, however the data are
plotted there too. I tried controlling the legend position by adding
x="topleft" but this results in an error that x matches multiple
formal
arguments.
Leaving out the legend and making a separate call to legend leaves out the
colors of bars ...
Please advice, Ingmar
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible Url : https://stat.ethz.ch/pipermail/r-help/attachments/20061013/3c9b6e26/attachment.pl
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@gmail.com>
Date: Fri, 13 Oct 2006 14:11:21 +0200
To: Ingmar Visser <I.Visser@uva.nl>
Cc: <R-help@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))
2006/10/13, Ingmar Visser < I.Visser@uva.nl>:> Dear useRs,
>
> I''m trying to create a barplot like so:
>
> x=matrix(1:10,2,5)
> barplot(x,leg=c("left","right"),besid=T)
>
> The legend is placed in default position topright, however the data are
> plotted there too. I tried controlling the legend position by adding
> x="topleft" but this results in an error that x matches multiple
formal
> arguments.
>
> Leaving out the legend and making a separate call to legend leaves out the
> colors of bars ...
>
> Please advice, Ingmar
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> <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.
--
David
[[alternative HTML version deleted]]
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))
>