[R] pb with Date format using filled.contour

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Mar 2 12:14:19 CET 2011


On Wed, 2 Mar 2011, Xavier Bodin wrote:

> Hi R-help community,
>
> Can anyone tell me why, while using :
>    x <- seq(as.Date("2001-01-01"),as.Date("2001-01-01") +
> nrow(volcano)-1,1)
>    y <- seq(1, ncol(volcano),1)
>
> when I plot the volcano matrix with that command :
>    filled.contour(x,y,volcano)
> the graph has a Date format on X-axis, ok ...
>
> ... but when adding a contour plot to the filled contour, using this
> command:
>    filled.contour(x,y,volcano,
> plot.axes={axis(1);axis(2);contour(x,y,volcano, add = TRUE)})
> the Date format doesn't appear anymore ... ??

You should not use using axis(1).  Look at the code for 
filled.contour:

     if (missing(plot.axes)) {
         if (axes) {
             title(main = "", xlab = "", ylab = "")
             Axis(x, side = 1)
             Axis(y, side = 2)
         }
     }

and then at the help for Axis and axis.

> Thanks in advance for any help,
>
> Xavier

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list