Commit 0e81e771 authored by Dorchies David's avatar Dorchies David
Browse files

feat(plot.GRiwrmOutputsModel): add clean title and extend arguments to plot.OutputsModel

Refs #26
parent a3c0276e
......@@ -17,8 +17,18 @@ plot.GRiwrmOutputsModel <- function(x, Qobs = NULL, ...) {
lapply(
names(x),
function(id, OutputsModels) {
plot(OutputsModels[[id]], Qobs = Qobs[,id] , main = id)
## 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(OutputsModels[[id]], Qobs = Qobs[,id], ...)
title(main = id, outer = TRUE, line = 1.2, cex.main = 1.4)
## reset original par
par(opar)
},
OutputsModels = x
)
invisible(NULL)
}
......@@ -140,12 +140,7 @@ OutputsModels <- RunModel(
## Plot the results for each basin
```{r, fig.height = 5, fig.width = 8}
htmltools::tagList(lapply(
names(OutputsModels),
function(x) {
plot(OutputsModels[[x]], Qobs = Qobs[IndPeriod_Run,x] , main = x)
}
))
plot(OutputsModels, Qobs = Qobs[IndPeriod_Run,])
```
The resulting flows of each node in m<sup>3</sup>/s is directly available and can be plotted with these commands:
......
......@@ -122,12 +122,7 @@ OM_OL <- RunModel(
As can be seen below, compared to results of vignette "V02_Calibration_SD_model", the use of measured flows on upstream influenced basins improves largely the model performance at downstream stations (better low flow simulations).
```{r, fig.height = 5, fig.width = 8}
htmltools::tagList(lapply(
names(OM_OL),
function(x) {
plot(OM_OL[[x]], Qobs = Qobs[IndPeriod_Run,x] , main = x)
}
))
plot(OutputsModels, Qobs = Qobs[IndPeriod_Run,], which = "Regime")
```
The resulting flows of each node in m<sup>3</sup>/s is directly available and can be plotted with these commands:
......
......@@ -262,7 +262,9 @@ data(QOBS)
```{r save}
ReduceOutputsModel <- function(OutputsModels, IndPeriod) {
items <- names(OutputsModels)
OutputsModelsOut <- sapply(items, function(x) {OutputsModels[[x]] <- OutputsModels[[x]][IndPeriod]})
OutputsModelsOut <- sapply(items, function(x) {
OutputsModels[[x]] <- OutputsModels[[x]][IndPeriod]
})
OutputsModelsOut$StateEnd <- OutputsModels$StateEnd
class(OutputsModelsOut) <- class(OutputsModels)
return(OutputsModelsOut)
......
......@@ -99,12 +99,7 @@ OutputsModels4 <- RunModel(
## Compare simulated naturalised flow with the ones given by EPTB SGL
```{r plot, fig.height = 5, fig.width = 8}
htmltools::tagList(lapply(
names(OutputsModels4),
function(x) {
plot(OutputsModels4[[x]], Qobs = Qnat[IndPeriod_Run,x] , main = x)
}
))
plot(OutputsModels4, Qobs = Qnat[IndPeriod_Run,])
```
# References
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