Commit 8b065248 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v0.2.10.108 fix: display plot.PrepGR when all Qobs are missing

Refs #35
parent 7401ed7a
Pipeline #19324 canceled with stages
Package: airGRteaching
Type: Package
Title: Teaching Hydrological Modelling with the GR Rainfall-Runoff Models ('Shiny' Interface Included)
Version: 0.2.10.107
Version: 0.2.10.108
Date: 2021-01-18
Authors@R: c(
person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@inrae.fr"),
......
......@@ -4,7 +4,7 @@
### 0.2.10.107 Release Notes (2021-01-18)
### 0.2.10.108 Release Notes (2021-01-18)
#### New features
......
......@@ -31,13 +31,19 @@ plot.PrepGR <- function(x, type = "l", col.Precip = "royalblue", col.Q = "black"
xlab = "", ylab = ylab[1L], main = main, ylim = rev(range(data$Precip)))
par(mar = c(5, 4, 0.1, 2), xaxt = "s")
plot(Qobs ~ DatesR, data = data, type = type, col = col.Q,
xlab = xlab, ylab = ylab[2L], main = "")
if (all(is.na(data$Qobs))) {
par(yaxt = "n")
plot(x = range(data$DatesR), y = c(0, 0), type = "n",
xlab = xlab, ylab = ylab[2L], main = "")
text(x = median(data$DatesR), y = 0, labels = "No Qobs")
} else {
plot(Qobs ~ DatesR, data = data, type = type, col = col.Q,
xlab = xlab, ylab = ylab[2L], main = "")
}
if (plot.na) {
axis(side = 1, at = as.POSIXct(data$DatesR[is.na(data$Qobs)]),
labels = FALSE, lwd.ticks = 3, col.ticks = col.na, tck = 0.025, lend = "butt")
legend("topright", legend = "NA", pch = 15, col = col.na, bty = "n", cex = 0.8)
}
......
Markdown is supported
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