#' @title plot measured / predicted #' #' @description Plot measured curve (in black) and predicted curve (in red) #' #' @param data Object return by \code{getData} #' @param pred Object as returned by \code{getForecast} #' @param index Index in forecasts #' #' @export plotPredReal <- function(data, pred, index) { horizon = length(pred$getSerie(1)) par(mar=c(4.7,5,1,1), cex.axis=2, cex.lab=2, lwd=2) measure = data$getSerie(pred$getIndexInData(index)+1)[1:horizon] yrange = range( pred$getSerie(index), measure ) plot(measure, type="l", ylim=yrange, lwd=3) par(new=TRUE) plot(pred$getSerie(index), type="l", col=2, ylim=yrange, lwd=3) } #' @title Plot filaments #' #' @description Plot similar days in the past + "past tomorrow", as black as distances are small #' #' @param data Object as returned by \code{getData} #' @param index Index in data #' @param limit Number of neighbors to consider #' #' @export plotFilaments <- function(data, index, limit=60) { index = dateIndexToInteger(index, data) ref_serie = data$getCenteredSerie(index) if (any(is.na(ref_serie))) stop("plotFilaments requires a serie without NAs") L = length(ref_serie) first_day = ifelse(length(data$getCenteredSerie(1)