Skip to content

plot.POSIXct with axes FALSE

2 messages · PIKAL Petr, Brian Ripley

#
Hallo all

I have a question regarding POSIX class objects.

I try tu use as.POSIXct for creating and plotting some time series. To be able to 
set labels for time (x) axis I started with plot(..., axes=FALSE) but although it 
suppressed all other axes, x axis is still plotted together with labels. Is it a bug?

see

datum.vyber<-seq(ISOdate(2000,1,1), ISOdate(2003,1,1), by="3 months")
plot(datum.vyber,1:13,axes=F)

in next command

axis.POSIXct(1,at=datum.vyber,format="%Y-%m")
axis(2)
box()

the x axis is overplotted with intended labels.

however I just found that I can use

plot(datum.vyber,1:13, xaxt="n") 
axis.POSIXct(1,at=datum.vyber,format="%Y-%m")

to get intended result. 

Why axes = FALSE does not work in case of POSIX classes?

Thank you.

Best regards
Petr Pikal
petr.pikal at precheza.cz
p.pik at volny.cz
#
On Mon, 7 Apr 2003, Petr Pikal wrote:

            
[...]
It is not a documented argument to plot.POSIXct!  Don't assume all plot 
methods take all the arguments of plot.default.

You should be using par(xaxt) and friends, as you found out.  Please do
read the documentation if you don't understand your errors.