plot_field_discrete: Plot gridded data with discrete intervals.

Description Usage Arguments Details Value Author(s) Examples

Description

Display geo-gridded data.

Usage

1
plot_field_discrete(x, lon, lat, lonlim = 'auto', latlim = 'auto', labels = c(), breaks, cscale = "Spectral", varname = "x", title = c(), mask = NULL, siglev = NULL, plot_only_sig = F, smooth = F, smooth_factor = 5, smooth_theta = 0.5, lineWidth = 0.5, dotSize = 0.5, GRID_STEP = 10, FONT_SIZE = 18)

Arguments

x

The data field to plot. It can be a matrix (suggested) or a vector. The matrix should have longitudinal data on the rows, otherwise the function will try to transpose the matrix giving a warning message. The data frame instead should have three columns with longitude, latitude and the data to plot.

lon

Longitude vector in the range -180, 180. If the longitude is provided in the 0, 360 range it will be transformed with a warning message.

lat

Latitude vector.

lonlim

Plot longitude range.

latlim

Plot latitude range.

labels

A character vector of labels associated to the breaks. The length of this vector should be equals to the length of breaks + 2 (the two extremes). If the length of the labels vector is zero, the function 'pretty_labels' is used on the breaks vector.

breaks

A vector with the break values. The breaks are considered "open" at both sides, i.e. -Inf and Inf are added at the extremes.

cscale

The colorscale, it may be the name of a colorbrewer palette (see http://colorbrewer2.org/) or a vector containing the colors used. Spectral palette is used as default.

rev_cscale

Reverse the color scale itemshow_lat_lon_labels Show the labels 'longitude' and 'latitude'

varname

Name of the plotted variables. It will appear into the legend.

title

Title of the plot.

mask

Data field to be used to mask the data for significance levels. It has the same dimensions of x.

siglev

Level of significance to show. All the points where mask <= siglev will be dotted.

plot_only_sig

Instead of displaying dots over the grid points that satisfy the condition mask < siglev, only those points will be shown leaving the rest of the data as NA.

smooth

Apply a spatial smoothing to the data to make it easier to read.

smooth_factor

The coefficient defining how much the shown grid will be finer than the original.

smooth_theta

The 'theta' factor of 'fields::image.smooth'

lineWidth

Width of the borders lines.

dotSize

Size of the dots used to show significance.

GRID_STEP

Distance between latitude/longitude axis labels

FONT_SIZE

Font size.

Details

Details about the smoothing process.

Value

Return a 'ggplot' object.

Author(s)

Matteo De Felice

Examples

1
2
data(ncep)
p = plot_field_discrete(z, lon, lat, breaks = c(5e-5, 1e-4))

matteodefelice/eneaR documentation built on May 21, 2019, 12:59 p.m.