Add polygon function for shading
Issue #5
closed
This can be a nice effect, e.g., between Bollenger bands.
rtsplot.polygon <- function (y, col = graphics::par("col"), ...) { y = y[, 1:2] temp.x = rtsplot:::rtsplot.map.xaxis(y)
n <- NROW(y) xx <- .index(y)[c(1, 1:n, n:1)] yu <- as.vector(coredata(y[, 1])) yl <- as.vector(coredata(y[, 2])) graphics::polygon(x = xx, y = c(yl[1], yu, rev(yl)), border = NA, col = col, ...) }
Comments (3)
-
repo owner -
repo owner - changed status to resolved
-
repo owner - changed status to closed
- Log in to comment
Thank you, great idea. Done, please see commit cdfb093
Please install development version
Please use the following code to test new functionality