[R] Getting tick positions

Uwe Ligges ligges at statistik.uni-dortmund.de
Sun Feb 27 16:07:59 CET 2005


Jim Lemon wrote:

> Thanks for the answers - I should have been more specific as I had already 
> tried axTicks and pretty.
> 
> The function in question is gantt.chart() in the latest plotrix package 
> (Thanks to Scott Waichler for the original code). I settled on axis.POSIXct 
> as it seemed the most appropriate for this function, but couldn't find a way 
> to get the positions of the ticks so that I could then draw grid lines along 
> the months|days|hours. While the trick of copying the original function 
> works, I wondered why the axis* functions don't return the tick positions as 
> barplot returns the bar positions. Is there any reason not to return "z", or 
> is it just historical?

I think historical.

Replacing
     return R_NilValue;
by
     return at;
in do_axis (plot.c) should do the trick (well, I'm a bit afraid 
concerning the UNPROTECT, you might need to do that later, after the 
recording stuff?).

Uwe Ligges


> Jim
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list