From d4cd80929567892830b209982f3687d83726f420 Mon Sep 17 00:00:00 2001
From: Delaigue Olivier <olivier.delaigue@irstea.priv>
Date: Fri, 7 Jun 2019 10:07:49 +0200
Subject: [PATCH] v1.2.16.24 DOC: example added in plot.OutputsModel doc

---
 DESCRIPTION              |  2 +-
 NEWS.rmd                 |  4 +++-
 man/plot.OutputsModel.Rd | 50 ++++++++++++++++++++++++++++++++++++++--
 3 files changed, 52 insertions(+), 4 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 240e5e03..c64d3845 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.23
+Version: 1.2.16.24
 Date: 2019-06-07
 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 fb464499..de29c732 100644
--- a/NEWS.rmd
+++ b/NEWS.rmd
@@ -14,7 +14,7 @@ output:
 
 
 
-### 1.2.16.23 Release Notes (2019-06-07)
+### 1.2.16.24 Release Notes (2019-06-07)
 
 
 #### New features
@@ -34,6 +34,8 @@ output:
 
 - <code>plot.OutputsModel()</code> now allowed new values for the which argument : <code>"all"</code> corresponds to all graphs, <code>"synth"</code> corresponds to the main graphs (by default; corresponding to <code>"all"</code> in the previous versions of the pcakage) (<code>c("Precip", "Temp", "SnowPack", "Flows", "Regime", "CumFreq", "CorQQ")</code>), "ts" corresponds to the time serie graphs (<code>c("Precip", "PotEvap", "Temp", "SnowPack", "Flows")</code>) and <code>"perf"</code> corresponds to the perfomance graphs (<code>c("Error", "Regime", "CumFreq", "CorQQ")</code>).
 
+- An example is addeed to illustred the use of the <code>plot.OutputsModel()</code> function.
+
 
 #### Minor user-visible changes
 
diff --git a/man/plot.OutputsModel.Rd b/man/plot.OutputsModel.Rd
index 42dcf694..27d2f2cc 100644
--- a/man/plot.OutputsModel.Rd
+++ b/man/plot.OutputsModel.Rd
@@ -64,7 +64,7 @@ Function which creates a screen plot giving an overview of the model outputs.
 
 
 \details{
-Different types of independent graphs are available (depending on the model):
+Different types of independent graphs are available (depending on the model, but always drawn in this order):
 \itemize{
   \item \code{"Precip"}: time series of total precipitation
   \item \code{"PotEvap"}: time series of potential evapotranspiration
@@ -93,5 +93,51 @@ Laurent Coron, Olivier Delaigue, Guillaume Thirel
 
 
 \examples{
-### See examples of RunModel_GR4J or RunModel_CemaNeigeGR4J functions
+### see examples of RunModel_GR4J or RunModel_CemaNeigeGR4J functions
+### to understand how the example datasets have been prepared
+
+
+## loading examples dataset for GR4J and GR4J + CemaNeige
+data(plotOutputsModel)
+
+
+### Qobs and outputs from GR4J and GR4J + CemaNeige models
+str(GR4J, max.level = 1)
+str(CNGR4J, max.level = 1)
+
+
+### default dashboard (which = "synth")
+
+## GR models whithout CemaNeige
+plot(GR4J$OutputsModel, Qobs = GR4J$Qobs)
+
+## GR models whith CemaNeige ("Temp" and "SnowPack" added)
+plot(CNGR4J$OutputsModel, Qobs = CNGR4J$Qobs)
+
+
+### "Error" and "CorQQ" plots cannot be display whithout Qobs
+plot(GR4J$OutputsModel, which = "all", Qobs = GR4J$Qobs)
+plot(GR4J$OutputsModel, which = "all", Qobs = NULL)
+
+
+### complex plot arrangements
+plot(GR4J$OutputsModel, Qobs = GR4J$Qobs,
+which = c("Flows", "Regime", "CumFreq", "CorQQ"),
+    LayoutMat = matrix(c(1, 2, 3, 1, 4, 4), ncol = 2),
+    LayoutWidths  = c(1.5, 1),
+    LayoutHeights = c(0.5, 1, 1))
+    
+    
+### add a main title
+
+## the whole list of settable par's
+opar <- par(no.readonly = TRUE)
+
+## define outer margins and a title inside it
+par(oma = c(0, 0, 3, 0))
+plot(GR4J$OutputsModel, Qobs = GR4J$Qobs)
+title(main = "GR4J outputs", outer = TRUE, line = 1.2, cex.main = 1.4)
+
+## reset original par
+par(opar)
 }
-- 
GitLab