From maechler@stat.math.ethz.ch  Wed Mar 22 10:40:47 2000
From: maechler@stat.math.ethz.ch (maechler@stat.math.ethz.ch)
Date: Wed, 22 Mar 2000 11:40:47 +0100 (MET)
Subject: [Rd] minor problem in barplot legend (PR#494)
Message-ID: <200003221040.LAA07976@pubhealth.ku.dk>

>>>>> "Ben" == Ben Bolker <bolker@zoo.ufl.edu> writes:

    Ben> If length(col)<length(legend.txt) in barplot, then the reversal of
    Ben> the legend leads to funny results.  For example:

    Ben> x <- matrix(runif(25),nrow=5)
    Ben> barplot(x,col=c("red","green","black"),legend=as.character(1:5),ylim=c(0,5))

    Ben> The (easy) fix is to replace

    Ben>     legend.col <- col

    Ben> with

    Ben>	legend.col <- rep(col,length=length(legend.text))

    Ben> on line 94 of barplot.default.

    Ben> Trivia, but hey, it confused me for a little while, it might as well
    Ben> be fixed.

Now done for "R-release", i.e. the (unreleased) future R 1.0.1

Thank you, Ben!
Martin

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] minor problem in barplot legend (PR#494)
maechler@stat.math.ethz.ch