Bug 14016 - plot.POSIXct uses wrong x axis
Summary: plot.POSIXct uses wrong x axis
Alias: None
Product: R
Classification: Unclassified
Component: Misc (show other bugs)
Version: old
Hardware: ix86 (32-bit) Windows 32-bit
: P5 normal
Assignee: Jitterbug compatibility account
Depends on:
Reported: 2009-10-20 11:43 UTC by Jitterbug compatibility account
Modified: 2015-12-14 13:44 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Jitterbug compatibility account 2009-10-20 11:43:25 UTC
From: karl@huftis.org
Full_Name: Karl Ove Hufthammer
Version: 2.10.0 beta
OS: Windows
Submission from: (NULL) (

When plotting a single POSIXct variable, 'plot' uses a nonsensical x axis. Here
is some example code:


The y axis correctly shows appropriate labels (years 2002 to 2006), but the x
axis show the single time '59:58' in the lower left corner.

Expected behaviour: The indices should be shown on the x axis, just like for
plot(x), where x is the x variable in the above example code.

Additional notes: While ?plot.POSIXct does not explicitly say that the second
variable ('y') is optional, the help for the generic, ?plot, does. And it seems
reasonable that it should be. Also plot(POSIXct.variable) does produce a
'correct' plot, except for the labels on the x axis.

Output of sessionInfo():

R version 2.10.0 beta (2009-10-17 r50136) 

[1] LC_COLLATE=Norwegian-Nynorsk_Norway.1252 
[2] LC_CTYPE=Norwegian-Nynorsk_Norway.1252   
[3] LC_MONETARY=Norwegian-Nynorsk_Norway.1252
[4] LC_NUMERIC=C                             
[5] LC_TIME=Norwegian-Nynorsk_Norway.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] tools_2.10.0

Comment 1 Brian Ripley 2010-04-12 10:00:57 UTC
This was not documented to work, but has been added as a new feature in 2.12.0