quick_plot_field: Plot a field from an eps model

Description Usage Arguments Value Examples

View source: R/quick_plot_field.R

Description

Uses the output of read_members to quickly plot a field with a coastline map

Usage

1
2
3
quick_plot_field(eps_field, member, legend = TRUE, hires_coast = FALSE,
  col = fields::tim.colors(), num_rows = NULL, diff = FALSE,
  land_colour = "transparent", ...)

Arguments

eps_field

Output of read_members.

member

Member to plot. Can be numeric or one of "mean", "sd", or "all".

legend

Whether to plot a legend - TRUE or FALSE. Defaults to TRUE.

hires_coast

Plot a high resolution coastline - TRUE or FALSE. Defaults to FALSE.

col

Colour palette, i.e. a vector of colours. If breaks are specified there must be fewer colours than breaks.

num_rows

Number of rows in a multi member plot.

diff

Whether to plot the difference between 2 members. TRUE or FALSE. Only works if exactly 2 members are specified in the member argument.

land_colour

Fill colour for land in the plot. Default is transparent.

...

Arguments for image.plot, e.g. for breaks and colour palette.

Value

A plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
my_file <- get_data_filename(20180101, 0)
t2m <- read_members(my_file, "T2m", lead_time = 0)
quick_plot_field(t2m, 0)

breaks <- c(-50, -40, - 30, seq(-20, 15, 5))
colour_palette <- c("blue", "skyblue", "lightgreen", "green", "yellow", "gold")
colours <- colorRampPalette(colour_palette)(length(breaks) - 1)
quick_plot_field(t2m, 0, col = colours, breaks = breaks, lab.breaks = breaks)

library(viridis)
quick_plot_field(t2m, 0, hires = TRUE, col = viridis(256))

quick_plot_field(t2m, "all", legend = FALSE, num_rows = 2, col = viridis(256))

andrew-MET/mepsr documentation built on Nov. 9, 2019, 6:30 a.m.