Skip to content

Commit

Permalink
bimprovement in plot.dsensemble.one
Browse files Browse the repository at this point in the history
  • Loading branch information
brasmus committed Apr 29, 2024
1 parent 3cfa034 commit 3952994
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: esd
Version: 1.10.78
Date: 2024-04-24
Version: 1.10.79
Date: 2024-04-29
Title: Climate analysis and empirical-statistical downscaling (ESD) package for monthly and daily data
Author: Rasmus E. Benestad, Abdelkader Mezghani, Kajsa M. Parding, Helene B. Erlandsen, Ketil Tunheim, and Cristian Lussana
Maintainer: Rasmus E. Benestad <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion R/idf.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ plot.IDF <- function(x,type='l',xlab='timescale (hrs)',ylab='return value (mm)',
if (is.null(cols)) cols <- rev(heat.colors(d[2]))
if ((is.null(main)) & !is.null(attr(x,'original_data')))
main <- paste(loc(attr(x,'original_data')),stid(attr(x,'original_data'))) else
if (is.null(main)) main <- 'Intensity-Duration-Frquency'
if (is.null(main)) main <- 'Intensity-Duration-Frequency'
plot(attr(x,'L'),x[,d[2]],type=type,xlab=xlab,ylab=ylab,main=main,...)
grid()
for (i in 1:d[2]) lines(attr(x,'L'),x[,i],col="grey30",lwd=2)
Expand Down
10 changes: 7 additions & 3 deletions R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -2198,6 +2198,8 @@ plot.dsensemble.multi <- function(x,it=c(2000,2099),FUNX='mean',verbose=FALSE,
#' @param test a boolean; if TRUE perform some test?
#' @param plot a boolean; if TRUE show plot
#' @param xval a boolean; if TRUE show cross-validation statistics
#' @param set2par0 a boleean; if TRUE, use original par() setting. Set to FALSE
#' for use within layout() or par(mfcol=c())
#' @param \dots additional arguments
#'
#' @export plot.dsensemble.one
Expand All @@ -2208,7 +2210,7 @@ plot.dsensemble.one <- function(x,pts=FALSE,it=0,
map.type=NULL,map.insert=TRUE,smooth=TRUE,
alpha=0.4,alpha.map=0.7,mar=c(5.1,4.5,4.1,2.1),
cex.axis=1, cex.lab=1.2, cex.main=1.2, xval.show=FALSE,
verbose=FALSE,...) {
main=NULL,verbose=FALSE,set2par0=TRUE,...) {
if(verbose) print("plot.dsensemble.one")
stopifnot(inherits(x,'dsensemble'))

Expand Down Expand Up @@ -2332,7 +2334,8 @@ plot.dsensemble.one <- function(x,pts=FALSE,it=0,
points(zoo(coredata(diag$y)[which(outside)],
order.by=year(diag$y)[which(outside)]),col="grey")
}
title(main=toupper(loc(x)),cex.main=cex.main)
if (is.null(main)) main <- toupper(loc(x))
title(main=main,cex.main=cex.main)
if ((target.show) & (!is.null(diag))) {
if (verbose) print('add target diagnostic')
dx0 <- fig[2]-fig[1]
Expand Down Expand Up @@ -2406,7 +2409,8 @@ plot.dsensemble.one <- function(x,pts=FALSE,it=0,
## added after the function has finished (except for some things that cannot be set)
dontset <- c("cin","cra","csi","cxy","din","page")
for(p in names(par0)[!names(par0) %in% dontset]) {
if(p!="fig" | (p=="fig" & setfig)) {
if ( (p!="fig" | (p=="fig" & setfig)) & set2par0) {
if (verbose) print(paste0("SETFIG: par(",p,"=par0$",p,")"))
eval(parse(text=paste0("par(",p,"=par0$",p,")")))
}
}
Expand Down
5 changes: 5 additions & 0 deletions man/plot.dsensemble.one.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3952994

Please sign in to comment.