diff --git a/DESCRIPTION b/DESCRIPTION index 1bfb2f09e5e5fc37d16b91ed3612413b0301a206..ed6ba35a9e2a76849542ffcebbdd5d767bb5fde4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: airGR Type: Package Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling -Version: 1.2.16.17 +Version: 1.2.16.18 Date: 2019-06-06 Authors@R: c( person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), diff --git a/NEWS.rmd b/NEWS.rmd index f9d4f8aa684ac9ad8fe44978586ab2e4555f641a..5410c61554eefcdb3a6e5f90a1e229ed6c52e289 100644 --- a/NEWS.rmd +++ b/NEWS.rmd @@ -14,7 +14,7 @@ output: -### 1.2.16.17 Release Notes (2019-06-06) +### 1.2.16.18 Release Notes (2019-06-06) #### New features diff --git a/R/plot.OutputsModel.R b/R/plot.OutputsModel.R index 802a81623edaa861bc4522c4a4566b39eddb2605..c9f8459da2d55b18e1f9623cc46c95df5b880bef 100644 --- a/R/plot.OutputsModel.R +++ b/R/plot.OutputsModel.R @@ -250,45 +250,41 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea = if (is.null(LayoutMat)) { matlayout <- NULL iPlot <- 0 + iHght <- NULL - Sum1 <- sum(c(BOOLPLOT_Precip, BOOLPLOT_SnowPack, BOOLPLOT_Flows)) - Sum2 <- sum(c(BOOLPLOT_Regime, BOOLPLOT_CumFreq, BOOLPLOT_CorQQ)) - if (BOOLPLOT_Precip) { - matlayout <- rbind(matlayout, c(iPlot + 1, iPlot + 1, iPlot + 1)) - iPlot <- iPlot + 1 - } - if (BOOLPLOT_PotEvap) { - matlayout <- rbind(matlayout, c(iPlot + 1, iPlot + 1, iPlot + 1), c(iPlot + 1, iPlot + 1, iPlot + 1)) - iPlot <- iPlot + 1 - } - if (BOOLPLOT_Temp) { - matlayout <- rbind(matlayout, c(iPlot + 1, iPlot + 1, iPlot + 1), c(iPlot + 1, iPlot + 1, iPlot + 1)) - iPlot <- iPlot + 1 - } - if (BOOLPLOT_SnowPack) { - matlayout <- rbind(matlayout, c(iPlot + 1, iPlot + 1, iPlot + 1), c(iPlot + 1, iPlot + 1, iPlot + 1)) + listBOOLPLOT1 <- c(Precip = BOOLPLOT_Precip, PotEvap = BOOLPLOT_PotEvap, + Temp = BOOLPLOT_Temp , SnowPack = BOOLPLOT_SnowPack, + Flows = BOOLPLOT_Flows , Error = BOOLPLOT_Error) + listBOOLPLOT2 <- c(Regime = BOOLPLOT_Regime, CumFreq = BOOLPLOT_CumFreq, + CorQQ = BOOLPLOT_CorQQ) + Sum1 <- sum(listBOOLPLOT1) + Sum2 <- sum(listBOOLPLOT2) + + for (k in seq_len(Sum1)) { + matlayout <- rbind(matlayout, iPlot + c(1, 1, 1)) iPlot <- iPlot + 1 + iHght <- c(iHght, 0.7) } - if (BOOLPLOT_Flows) { - matlayout <- rbind(matlayout, c(iPlot + 1, iPlot + 1, iPlot + 1), c(iPlot + 1, iPlot + 1, iPlot + 1)) - iPlot <- iPlot + 1 + ## Flows plot is higher than the other TS + listBOOLPLOT1 <- listBOOLPLOT1[listBOOLPLOT1] + listBOOLPLOTF <- (names(listBOOLPLOT1) == "Flows") * BOOLPLOT_Flows + iHght <- iHght + listBOOLPLOTF * listBOOLPLOT1 * 0.3 + if (Sum2 >= 1) { + iHght <- c(iHght, 1.0) } - if (BOOLPLOT_Error) { - matlayout <- rbind(matlayout, c(iPlot + 1, iPlot + 1, iPlot + 1), c(iPlot + 1, iPlot + 1, iPlot + 1)) - iPlot <- iPlot + 1 - } if ((Sum1 >= 1 & Sum2 != 0) | (Sum1 == 0 & Sum2 == 3)) { - matlayout <- rbind(matlayout, c(iPlot + 1, iPlot + 2, iPlot + 3), c(iPlot + 1, iPlot + 2, iPlot + 3)) + matlayout <- rbind(matlayout, iPlot + c(1, 2, 3)) iPlot <- iPlot + 3 } if (Sum1 == 0 & Sum2 == 2) { - matlayout <- rbind(matlayout, c(iPlot + 1, iPlot + 2)) + matlayout <- rbind(matlayout, iPlot + c(1, 2)) iPlot <- iPlot + 2 } if (Sum1 == 0 & Sum2 == 1) { matlayout <- rbind(matlayout, iPlot + 1) iPlot <- iPlot + 1 } + iPlotMax <- iPlot # isRStudio <- Sys.getenv("RSTUDIO") == "1"; @@ -306,7 +302,7 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea = #} LayoutWidths <- rep.int(1, ncol(matlayout)) - LayoutHeights <- rep.int(1, nrow(matlayout)) + LayoutHeights <- iHght #rep.int(1, nrow(matlayout)) } if (!is.null(LayoutMat)) { matlayout <- LayoutMat