From 5ea0e01fed996c38fb412b65660be37aa90422a9 Mon Sep 17 00:00:00 2001 From: Delaigue Olivier <olivier.delaigue@irstea.priv> Date: Mon, 18 Mar 2019 12:07:25 +0100 Subject: [PATCH] v1.2.9.16 BUG: the X-axis of plot.OutputsModel now appears whith GR2M when the dates of the time series are not the 1st of the month --- DESCRIPTION | 2 +- NEWS.rmd | 2 +- R/plot.OutputsModel.R | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 11cdda52..576b8e98 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.9.15 +Version: 1.2.9.16 Date: 2019-03-18 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 21418866..e0c999a8 100644 --- a/NEWS.rmd +++ b/NEWS.rmd @@ -13,7 +13,7 @@ output: -### 1.2.9.15 Release Notes (2019-03-18) +### 1.2.9.16 Release Notes (2019-03-18) diff --git a/R/plot.OutputsModel.R b/R/plot.OutputsModel.R index 64758308..fddf412e 100644 --- a/R/plot.OutputsModel.R +++ b/R/plot.OutputsModel.R @@ -108,6 +108,9 @@ plot.OutputsModel <- function(x, Qobs = NULL, IndPeriod_Plot = NULL, BasinArea = NameTS <- "month" plotunit <- "[mm/month]" formatAxis <- "%m/%Y" + if (format(OutputsModel$DatesR[1L], format = "%d") != "01") { + OutputsModel$DatesR <- as.POSIXlt(format(OutputsModel$DatesR, format = "%Y-%m-01"), tz = "UTC", format = "%Y-%m-%d") + } } if (inherits(OutputsModel, "yearly") & TimeStep %in% (c(365, 366) * 24 * 60 * 60)) { -- GitLab