1

In the older xts packages (until I think 0.9-7), one could suppress the x-axis using xaxt = "n". In the newer version of the package, however, this doesn't work anymore.

Sample code:

# remove new version of xts
remove.packages(xts)

# install predownloaded 0.9-7 version of xts from 
# https://cran.r-project.org/src/contrib/Archive/xts/
install.packages("C:/xts_0.9-7.tar.gz", repos = NULL)
library(xts)

# load sample data
data(sample_matrix)
sample.xts <- as.xts(sample_matrix)

# plot sample data
plot(sample.xts[,1], xaxt = "n")

xts plot using xtx 0.9-7

# remove that version of xts and install new version
remove.packages(xts)
install.packages("xts")

# load package and sample data
library(xts)
data(sample_matrix)
sample.xts <- as.xts(sample_matrix)

# plot sample data
plot(sample.xts)

xts plot using xts 0.10

Is there a way of removing the xaxis of the plot?

smoff
  • 592
  • 5
  • 21
  • Maybe use plot.zoo(sample.xts[,1], xaxt="n", ylab="") as suggested [here](https://stackoverflow.com/questions/6165239/remove-y-axis-label-from-plot-of-an-xts-object) – Edgar Santos Aug 09 '17 at 05:30
  • `plot.zoo` is a working alternative. Still I would love it, if it would work in `plot.xts`, too, so I don't need to rewrite a lot of code – smoff Aug 09 '17 at 11:25
  • 2
    [This is a bug](https://github.com/joshuaulrich/xts/issues/196) – Joshua Ulrich Aug 09 '17 at 12:51

0 Answers0