plot.thornthwaite: Thornthwaite - Mather's quantile plot

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/plot_quant.R

Description

'plot' method implementation for 12-month quantile climate charts from output of function thornthwaite (Thornthwaite and Mather's water balance).

Usage

1
2
3
4
5
## S3 method for class 'thornthwaite'
plot(x, save_dir = NULL, format = NULL,
  variables = c("Precipitation", "Et0", "Storage", "Prec. - Evap.", "Deficit",
  "Surplus"), title = TRUE, trace_grid = TRUE, st_name = NULL,
  u_y_scale_magn = 0.2, l_y_scale_magn = 0, leg_pos = "topleft", ...)

Arguments

x

a list of quantile data frames of water balance variables to be plotted, as output of function thornthwaite.

save_dir

name of destination directory for graphs (if any). Default is NULL.

format

graphic format of graphs; default is NULL (charts are sent to console).

variables

character vector of variables to be plotted.

title

logic. If TRUE inserts titles in charts.

trace_grid

logic. If TRUE (default) adds a grid.

st_name

name to be included into graphs titles. If NULL (default), no title is written.

u_y_scale_magn

magnification of range above upper limit, to set upper y-scale limit; default is 0.

l_y_scale_magn

magnification of range below lower limit, to set lower y-scale limit; default is 0.1.

leg_pos

legend position. Default is "topleft". If NULL, no legend is added.

...

arguments to be passed to methods, such as graphical parameters (see par).

Details

Default for plot variables is all those calculated by function thornthwaite: "Precipitation", "Et0", "Storage", "Prec. - Evap.", "Deficit", "Surplus". See function thornthwaite for details on variables.

If format is NULL (default), graphs are sent to the console. Otherwise, a file is produced and saved to the save_dir directory. Values allowed are: "png", "jpeg", "tiff", "bmp".

l_y_scale_magn and u_y_scale_magn are the magnification coefficients (lower and upper, respectively), for y scale. If rng is the range between maximum and minimum values in all sets of series within a plot, the lower limit for y scale will be (rng * l_y_scale_magn) below the lower value, and the upper limit will be (rng * u_y_scale_magn) above the upper value of series.

Allowed values for leg_pos are the same of x in function legend.

Most graphic parameters for functions plot and legend are accepted.

Value

Charts of quantiles for water balance variables (12-month climatic values). They can be sent to the console or saved as graphic files.

Note

A conflict is generated if parameters already used by the function are passed (e.g. x for legend: use leg_pos instead).

Author(s)

Emanuele Eccel

See Also

thornthwaite

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(Trent_climate)


# quantiles is the list ("thornthwaite" S3 object)of quantile tables generated 
# by function thornthwaite; 
# it is the second element of the output list, 
# which can be split into two separate lists (see function thornthwaite)
sta <- 1     # 1st station in the list of quantile tables
q_list=quantiles[[sta]]
class(q_list) <- "thornthwaite" ## q_list is coerced to a "thornthwaite" S3 object
plot(q_list, 
st_name=names(quantiles)[sta], variables=c("Precipitation",  "Et0"), 
leg_pos = "topleft", col=c(1:6,1), pch=c(1:6,16),  
lty=1, horiz=TRUE,  y.intersp=0.1)

ClimClass documentation built on May 2, 2019, 2:20 p.m.