plot.wux.df: X - Y Scatterplot of climate change signals

Description Usage Arguments Author(s) Examples

View source: R/PlotFunctions.R

Description

plot.wux.df plots one or more scatterplots containing climate change signals of selected meteorological parameters.

This plotting routine extracts all the information from the input data frame which has to be 'WUX-style' (see models2wux).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## S3 method for class 'wux.df'
plot(x,
               var1.name = "delta.air_temperature",
               var2.name = "perc.delta.precipitation_amount",
               subreg.subset = NULL,
               season.subset = NULL, boxplots = TRUE,
               label.only.these.models = NULL, highlight.models = NULL,
                no.text = FALSE,
               vert.box.col = "cyan", horiz.box.col = "coral",
               zero.line.col = "gray80", median.line.col = "black",
               draw.legend = TRUE, draw.seperate.legend = FALSE,
               draw.median.lines = TRUE, use.rainbow.colors = TRUE,
               xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL,
               main = NULL, out.file.directory = NULL,
               out.file.name = NULL, copyright = FALSE, ...)

Arguments

x

WUX data.frame (class wux.df) obtained from models2wux'.

var1.name

Character string of 1st parameter in WUX dataset. Default is temperature change.

var2.name

Character string of 2nd parameter in WUX dataset. Default is precipitation change.

subreg.subset

Vector of subregions to be plotted (e.g. c("EU.ENS", "GAR")).

season.subset

Vector of seasons to be plotted (e.g. c("MAM", "DJF")).

boxplots

Boolean. Indicating if marginal boxplots for the two input parameters should be plotted. Default is TRUE.

label.only.these.models

Character vector of modelnames (acronyms) to be labeled in the scatterplot.

highlight.models

Character vector of modelnames (acronyms) to be highlighted in the scatterplot.

no.text

Boolean. Indicating if no models should be labeled. Default is FALSE.

vert.box.col

Color character for vertical boxplot. Default is coral.

horiz.box.col

Color character for horizontal boxplot. Default is cyan.

zero.line.col

Color character for the zero lines. Default is gray80.

median.line.col

Color character for the median lines. Default is black.

use.rainbow.colors

Boolean. Use rainbow() color palette if TRUE, otherwise a custom color palette with 17 colors is used. Default is TRUE.

xlim

Range vector for 1st parameter (x-axis).

ylim

Range vector for 2nd parameter (y-axis).

xlab

Label of 1st parameter (x-axis).

ylab

Label of 2nd parameter (y-axis).

draw.legend

Boolean. Indicating if legend with GCMs should be plotted. Default is TRUE.

draw.seperate.legend

Boolean. Should legend with GCMs be plotted on a seperate screen? Default is FALSE. Draws legend even if draw.legend is set FALSE.

draw.median.lines

Draw median lines for both parameters. Default is TRUE.

main

Main title.

out.file.directory

Directory where the plots shall be exported (e.g. "/tmp/plots/"). If neither out.file.name nor out.file.directory are passed, the plot will be displyed on screen.

out.file.name

Prefix of the file names of the plots. Files will be stored as out.file.name_subreg_season.eps, where subreg is one realization of the subreg.subset argument and season is one realization of season.subset. For example: out.file.name = "scatterplot" will store to the files scatterplot_EUROPE_DJF.eps and scatterplot_EUROPE_JJA.eps. If neither out.file.name nor out.file.directory are passed, the plot will be displyed on screen.

copyright

Boolean. If a copyright message should be plotted. Default is FALSE.

...

Further optional arguments to be passed to plot, such as graphical parameters (see par).

Author(s)

Thomas Mendlik [email protected] and Georg Heinrich [email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require(wux)

### ENSEMBLES RCM analysis
data(ensembles)

## Not run: plot(ensembles, "perc.delta.precipitation_amount",
  "delta.air_temperature", boxplots = TRUE, xlim = c(-40,40),
  ylim = c(0, 4), label.only.these.models = c("ICTP-REGCM3", "MPI-M-REMO"), 
  xlab = "Precipitation Amount [%]", ylab = "2-m Air Temperature [K]",
  main = "Scatterplot", subreg.subset = c("GAR"))

## End(Not run)

### now see where ENSMEBLES GCMs lie within CMIP3 ensemble
data(ensembles_gcms) # GCMs for forcing of ENSEMBLES RCMs
data(cmip3_2050)     # GCMs of CMIP3 ensemble

ensembles.gcm.names <- levels(ensembles_gcms$acronym) #8 GCM names

cmip3_2050.sub <- subset(cmip3_2050, subreg %in% c("World", "EU.ENS")
                       & em.scn == "A1B") 
cmip3_2050.sub <- droplevels(cmip3_2050.sub)
ensembles_gcms.sub <- subset(ensembles_gcms, !acronym %in%
                                c("mpi_echam5-r3", "bccr_bcm2_0-r1",
                                  "ipsl_cm4-r2"))
ensembles_gcms.sub <- droplevels(ensembles_gcms.sub)
## combine cmip3 and ENSEMBLES GCMs in one data.frame
gcms.combined <- rbind(ensembles_gcms.sub, cmip3_2050.sub)

## Scatterplot
prec.range <- range(gcms.combined$perc.delta.precipitation_amount) + c(-1, 1)
tas.range <- range(gcms.combined$delta.air_temperature)
## Not run: plot(gcms.combined,
               "perc.delta.precipitation_amount", "delta.air_temperature",
               subreg.subset = "EU.ENS", draw.median.lines = FALSE,
               label.only.these.models = ensembles.gcm.names,
               xlim = prec.range,
               ylim = tas.range,
               main = "GCMs from ENSEMBLES project within CMIP3 SRESA1B ensemble",
               draw.seperate.legend = TRUE)
## End(Not run)

wux documentation built on May 30, 2017, 8:22 a.m.