update documention, fix package to compete with 'method Bruno'
[talweg.git] / pkg / R / plot.R
index 2b74117..2488d81 100644 (file)
@@ -11,13 +11,7 @@ plotCurves <- function(data, indices=seq_len(data$getSize()))
        series = data$getSeries(indices)
        yrange = quantile(series, probs=c(0.025,0.975), na.rm=TRUE)
        par(mar=c(4.7,5,1,1), cex.axis=1.5, cex.lab=1.5)
-       for (i in seq_along(indices))
-       {
-               plot(series[,i], type="l", ylim=yrange,
-                       xlab=ifelse(i==1,"Time (hours)",""), ylab=ifelse(i==1,"PM10",""))
-               if (i < length(indices))
-                       par(new=TRUE)
-       }
+       matplot(series, type="l", ylim=yrange, xlab="Time (hours)", ylab="PM10")
 }
 
 #' Plot error
@@ -172,8 +166,8 @@ computeFilaments <- function(data, pred, index, predict_from, limit=60, plot=TRU
                ref_serie = c( data$getCenteredSerie( pred$getIndexInData(index)-1 ),
                        data$getCenteredSerie( pred$getIndexInData(index) ) )
                centered_series = rbind(
-                       data$getCenteredSeries( pred$getParams(index)$indices ),
-                       data$getCenteredSeries( pred$getParams(index)$indices+1 ) )
+                       data$getCenteredSeries( pred$getParams(index)$indices-1 ),
+                       data$getCenteredSeries( pred$getParams(index)$indices ) )
                yrange = range( ref_serie,
                        quantile(centered_series, probs=c(0.025,0.975), na.rm=TRUE) )
                par(mar=c(4.7,5,1,1), cex.axis=1.5, cex.lab=1.5, lwd=2)