joshuaulrich / xts

Extensible time series class that provides uniform handling of many R time series classes by extending zoo.
http://joshuaulrich.github.io/xts/
GNU General Public License v2.0
219 stars 71 forks source link

Refactored plot functionality does not support negative values for `on` #409

Closed joshuaulrich closed 10 months ago

joshuaulrich commented 10 months ago

This used to render the red line from addSeries() behind the black line from plot()

library(xts)
x <- xts(1:10, .Date(1:10))
plot(x)
addSeries(x, on = -1, col = "red", lwd = 5)
packageVersion("xts")
## [1] '0.13.1'

image

It's an error after the refactor.

plot(x)
addSeries(x, on = -1, col = "red", lwd = 5)
## Error in Env$panels[[n]] : invalid negative subscript in get1index <real>
packageVersion("xts")
## [1] '0.13.2'