plot_field: Plot a single field in matrix form

Description Usage Arguments

View source: R/plot.R

Description

Transform the field into a data frame using fld2df and plot using the ggplot2 package.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plot_field(
  fld,
  griddata,
  nb = 6,
  minval = -3.5,
  maxval = 3.5,
  legendstr = "Temperature (K)",
  palettestr = "RdYlBu",
  palettedir = -1
)

Arguments

fld

Vector of ngrid=nlat*nlon values: a single time slice of the field.

griddata

The griddata structure returned from read.temperatures.

nb

Number of breaks in the color scale. If nb < 2, use a smooth gradient.

minval

Lower limit of the color scale. The default value was chosen to work well for fields of residuals from the mean temperature response.

maxval

Upper limit of the color scale. The default value was chosen to work well for fields of residuals from the mean temperature response.

legendstr

String to use for the title of the graph legend

palettestr

String with the name of the ggplot2 color palette to use. Defaults to 'RdYlBu'. Options are Diverging: 'BrBG', 'PiYG', 'PRGn', 'PuOr', 'RdBu', 'RdGy', 'RdYlBu', 'RdYlGn', 'Spectral'; Qualitative: 'Accent', 'Dark2', 'Paired', 'Pastel1', 'Pastel2', 'Set1', 'Set2', 'Set3'; Sequential: 'Blues', 'BuGn', 'BuPu', 'GnBu', 'Greens', 'Greys', 'Oranges', 'OrRd', 'PuBu', 'PuBuGn', 'PuRd', 'Purples', 'RdPu', 'Reds', 'YlGn', 'YlGnBu', 'YlOrBr', 'YlOrRd'.

palettedir

Numerical value, only accepts 1 or -1, determining the order of the color palette used. Defaults to -1.


JGCRI/fieldgenr documentation built on July 22, 2020, 3:17 a.m.