[Rd] dotplot() colors reversed (PR#580)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
25 Jun 2000 23:37:58 +0200


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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._