[R] Dates in 'persp' plots

Josh Quigley josh.quigley at tibra.com.au
Mon Jul 16 05:49:42 CEST 2007


Hello,

I would like to have the y axis show dates in a 3D 'persp' plot.

The following example works...

	x <- spot
	y <- as.numeric(dates)    # class(dates) produces output [1] "Date"
	z <- t(price)

	persp(x, y, z, ticktype="detailed")


...however the y axes contains 'meaningless' integers (days since 1970-01-01
is not very intuitive!)

Changing the commented line above to 

	y <- dates

is no good because 'persp' automatically coerces input to numeric types.

I would really like the axis to be labeled with dates. A string, eg
"13-Jul-2007" would be best, but ISO date integer, eg 20070713, would also
be acceptable.

I've checked help for 'persp' and 'par' with no luck - any ideas
appreciated!

Cheers,

Josh.



More information about the R-help mailing list