From p.dalgaard@biostat.ku.dk  Sun Jun 25 22:37:58 2000
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 25 Jun 2000 23:37:58 +0200
Subject: [Rd] dotplot() colors reversed (PR#580)
In-Reply-To: rnassar@duke.edu's message of "Sun, 25 Jun 2000 21:38:56 +0200 (MET DST)"
References: <200006251938.VAA10074@pubhealth.ku.dk>
Message-ID: <x2vgyxigqx.fsf@blueberry.kubism.ku.dk>

rnassar@duke.edu writes:

> dotplot() colors are plotted (probably unintentionally?) in reverse order.
> 
> x <- c(rep(1,3),rep(2,3),rep(3,3))
> dotplot(x,groups=factor(x),col=x)        # 1 plotted with col=3, etc.

Yes. This is caused by 

        o <- rev(order(as.numeric(groups)))
        x <- x[o]
        groups <- groups[o]

and no corresponding reordering of color. A little care is needed when
fixing this since color is not necessarily a vector. Same thing with
lcolor, by the way.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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] dotplot() colors reversed (PR#580)
Peter Dalgaard BSA