On May 11, 2010, at 11:52 AM, D Holl wrote:

Dear all

I would like to plot a Gantt chart type plot, but with more than one
colour on a line. The gantt.chart function will allow me to add more
than one bar on a line, but it is in the same colour as the first bar
on that line. For example (using the code helpful provided in the R
graphics gallery)

require(plotrix)

Ymd.format <- "%Y/%m/%d"

Ymd <- function(x){ as.POSIXct(strptime(x, format=Ymd.format))}
gantt.info <- list(
 labels     =c("First task","Second task","Third task","Fourth
task","Fifth task","First task"),
starts = Ymd (c("2004/01/01","2004/02/02","2004/03/03","2004/05/05","2004/09/09",
"2004/09/01")),
ends = Ymd (c("2004/03/03","2004/05/05","2004/05/05","2004/08/08","2004/12/12",
"2004/09/10")),
 priorities =c(1,2,3,4,5,5))

gantt.chart(gantt.info,main="Calendar date Gantt chart")

Both bars in the first line are red=priority level 1, rather than one
red (level 1) and one purple (level 5)

Am I missing some simple option in the gantt.chart function, or do I
have to program the chart another way?

Looking at the code, it is fairly clear that the coloring is at the task level (taskcolors is the variable after all) rather than at the interval level.

--
David.

Many thanks for any assistance,

Kind regards

DD

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

David Winsemius, MD
West Hartford, CT

______________________________________________
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