Hi,

I am facing a problem with the legend, I donĀ“t know how to use the fill
option in the legend in order to achieve the same standard gray levels
that are plotted.

Sorry for this easy one, but I really did not find anything so far.

It works fine with color:

###### C O L O R
mat <- matrix(2,3,rep(2,6))
rownames(mat)<-c("A","B","C")
par(xpd=T, mar=par()$mar+c(2,0,0,0))
barplot(mat,col=rainbow(3))
legend(1,-2,legend=rownames(mat),fill=rainbow(3))

however

### G R A Y  ??

par(xpd=T, mar=par()$mar+c(2,0,0,0))
barplot(mat)  # now without color
legend(1,-2,legend=rownames(mat),fill=gray(0.1:0.3)) # this gray does
not work

could anyone help me out, please?
Thank you!

Jens

______________________________________________
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