Commit 32a3c9e0 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

fix: correct 'plot.OutputsModel' zoom when 'IndPeriod_Plot' does not start to 1

Refs: #192
1 merge request!100Resolve "IndPeriod_Plot not working as expected"
Pipeline #57707 passed with stage
in 5 minutes and 18 seconds
Showing with 3 additions and 2 deletions
+3 -2
...@@ -19,10 +19,11 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea = ...@@ -19,10 +19,11 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea =
## index time series ## index time series
if (!is.null(IndPeriod_Plot)) { if (!is.null(IndPeriod_Plot)) {
if (length(IndPeriod_Plot) == 0) { if (length(IndPeriod_Plot) == 0 || any(IndPeriod_Plot <= 0)) {
IndPeriod_Plot <- seq_along(OutputsModel$DatesR) IndPeriod_Plot <- seq_along(OutputsModel$DatesR)
warning('IndPeriod_Plot')
} }
IndPeriod_Plot <- seq_along(IndPeriod_Plot) # IndPeriod_Plot <- seq_along(IndPeriod_Plot)
OutputsModel <- .IndexOutputsModel(OutputsModel, IndPeriod_Plot) OutputsModel <- .IndexOutputsModel(OutputsModel, IndPeriod_Plot)
Qobs <- Qobs[IndPeriod_Plot] Qobs <- Qobs[IndPeriod_Plot]
} else { } else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment