Learn R Programming

plan (version 0.4-2)

plot.gantt: Draw a Gantt diagram

Description

Plot a Gantt object.

Usage

# S3 method for gantt
plot(x,
           xlim,
           time.format = NULL,
           time.labels.by, time.lines.by,
	   event.time = NULL, event.label = NULL, event.side=3,
	   col.done = gray(0.3), col.notdone = gray(0.9),
	   col.event = gray(0.1), col.connector = "black",
           grid.col = "lightgray", grid.lty = "dotted",
	   main = "",
	   cex=par("cex"), 
	   debug=FALSE,
 ...)

Arguments

x

an object of class gantt.

xlim

optional range of time axis; if not provided, the range of times in x will be used.

time.format

format for dates on time axis; defaults to 3-letter month.

time.labels.by

suggested label increment on time axis, e.g. time.labels.by="2 months" to get a two-month interval. If not supplied, the axis will be generated automatically.

time.lines.by

suggested interval between vertical grid lines on the plot, e.g. time.lines.by="1 week" for weekly. If not supplied, the grid will be generated automatically.

event.time

List of events, e.g. conferences, whose time cannot be altered.

event.label

list of names of these events.

event.side

side for event labels.

col.done

colour of work that has been done already.

col.notdone

colour of work that has not been done already.

col.event

colour of events.

col.connector

colour of (optional) connectors between items.

grid.col

colour for grid

grid.lty

line type for grid

main

character string to be used as chart title.

cex

numeric, font-size factor.

debug

boolean, set to TRUE to monitor the work.

...

extra things handed down.

Value

The gantt object, returned invisibly.

Details

Plots a gantt chart, possibly with events superimposed.

References

Gantt diagrams are described on wikipedia http://en.wikipedia.org/wiki/Gantt_Chart.

See Also

Use read.gantt to read gantt data, and summary.gantt to summarize them.

Examples

Run this code
# NOT RUN {
library(plan)
data(gantt)
summary(gantt)
plot(gantt)
# Add a couple of event
event.label <- c("Proposal", "AGU")
event.time <- c("2008-01-28", "2008-12-10")
plot(gantt, event.label=event.label,event.time=event.time)
# }

Run the code above in your browser using DataLab