I would like to produce a chart that looks like a Gantt chart (or shingle plot), but instead of tasks you have variable names and instead of start and finish dates you have an upper and lower numeric value. If that makes sense, is there an obvious way of doing this. Thanks, Graham
?segments segments will draw the lines for you, You can also use 'rect' for rectangles. So the functions are there to draw it, you just have to decide how you want it to look. On Fri, Oct 17, 2008 at 3:22 PM, Graham Smith <myotisone at gmail.com> wrote:> I would like to produce a chart that looks like a Gantt chart (or > shingle plot), but instead of tasks you have variable names and > instead of start and finish dates you have an upper and lower numeric > value. > > If that makes sense, is there an obvious way of doing this. > > Thanks, > > Graham > > ______________________________________________ > R-help at 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. >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve?
Gabor Grothendieck
2008-Oct-17 20:04 UTC
[R] Simple Gantt like chart for numbers rather dates
You could consider modifying the code for gantt.chart in plotrix. On Fri, Oct 17, 2008 at 3:22 PM, Graham Smith <myotisone at gmail.com> wrote:> I would like to produce a chart that looks like a Gantt chart (or > shingle plot), but instead of tasks you have variable names and > instead of start and finish dates you have an upper and lower numeric > value. > > If that makes sense, is there an obvious way of doing this. > > Thanks, > > Graham > > ______________________________________________ > R-help at 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. >
> You could consider modifying the code for gantt.chart in plotrix.Not sure that I have the skills, but I was tempted when I found plotrix earlier today, to see if it could be modified someway. Thanks, Graham
Gabor Grothendieck wrote:> You could consider modifying the code for gantt.chart in plotrix. > > On Fri, Oct 17, 2008 at 3:22 PM, Graham Smith <myotisone at gmail.com> wrote: > >> I would like to produce a chart that looks like a Gantt chart (or >> shingle plot), but instead of tasks you have variable names and >> instead of start and finish dates you have an upper and lower numeric >> value. >> >> If that makes sense, is there an obvious way of doing this. >>Hi Graham, Gabor is right, gantt.chart comes close but you will have to change all the POSIXct axis calls to plain old axis calls and manually create the list of gantt.info with the x values as numbers. Jim
Jim,> Gabor is right, gantt.chart comes close but you will have to change all the > POSIXct axis calls to plain old axis calls and manually create the list of > gantt.info with the x values as numbers.Mmm, I have had a quick look at the code and it seems a bit beyond me, but it could be a good exercise :-) Certainly, this exactly what I want. Thanks, Graham
Gabor Grothendieck
2008-Oct-19 13:12 UTC
[R] Simple Gantt like chart for numbers rather dates
Then try something like this. We plot it as a stacked horizontal bargraph where the first bar in the stack is white and with border = 0 so its not visible. # test data - rows are from and to points and # column names are the labels mat <- matrix(1:10, 2, byrow = TRUE, dimnames = list(c("from", "to"), letters[1:5])) bp <- barplot(mat, col = c("white", "lightblue"), border = 0, horiz = TRUE) text(mat[1, ], bp, mat[1,], pos = 4) text(colSums(mat), bp, mat[2,], pos = 2) On Sun, Oct 19, 2008 at 6:49 AM, Graham Smith <myotisone at gmail.com> wrote:> Jim, > >> Gabor is right, gantt.chart comes close but you will have to change all the >> POSIXct axis calls to plain old axis calls and manually create the list of >> gantt.info with the x values as numbers. > > Mmm, I have had a quick look at the code and it seems a bit beyond me, > but it could be a good exercise :-) > > Certainly, this exactly what I want. > > Thanks, > > Graham > > ______________________________________________ > R-help at 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. >