From ligges at statistik.uni-dortmund.de  Mon Sep 29 14:01:15 2003
From: ligges at statistik.uni-dortmund.de (ligges@statistik.uni-dortmund.de)
Date: Mon Sep 29 13:00:34 2003
Subject: [Rd] colours in dotchart (PR#4343)
Message-ID: <200309291101.h8TB1F0P002820@pubhealth.ku.dk>

i.wilson@maths.abdn.ac.uk wrote:

> Problem:  neither fg or bg
> nor color work properly in dotchart.
> 
> version:  R-1.7.1 for windows
> 
> code which shows the errors:
> 
> x <-
> matrix(rnorm(16),ncol=2,dimnames=list(paste("a",1:8,sep=""),c("before","afte
> r")))
> dotchart(x,fg="blue",bg="lightgrey")

That's *not* a bug! It is not documented that *all* graphical parameters 
known from par() do work in dotchart() or any other high-level function 
(you won't find many!).

Instead, use

  par(fg = "blue", bg = "lightgrey")
  dotchart(x)


> dotchart(x,color=c("red","blue"))

That's *not* a bug! "color" is recycled, but in another way than you 
expected.

Instead, use

  dotchart(x, color = rep(c("red", "blue"), each = nrow(x)))


Please do submit bug reports if you are sure that's a bug. For questions 
use the mailinglist r-help, please.


Uwe Ligges


> 
> Dr Ian J Wilson
> Lecturer in Statistics
> Department of Mathematical Sciences
> University of Aberdeen
> King's College
> Aberdeen, AB24 3UE
> 
> Tel: +44(0)1224 272609
> Fax: +44(0)1224 272607
> 
> I.Wilson@maths.aberdeen.ac.uk
> http://www.maths.abdn.ac.uk/~ijw


[Rd] colours in dotchart (PR#4343)
ligges@statistik.uni-dortmund.de