map.stippling: Climatological map stippling

View source: R/spatialPlot.R

map.stipplingR Documentation

Climatological map stippling

Description

Create a points panel layout to add to spatialPlot. Typically needed to stipple significant points in climatologies, or other types of coordinates

Usage

map.stippling(clim, threshold = 0.05, condition = "LT", ...)

Arguments

clim

A climatology. This can be for instance a verification climatology as produced by easyVeri2grid. This often contains p-values, but not necessarily.

threshold

Reference threshold value to specify stippling points. Default to 0.05, in combination with condition = "LT", as tipically used for stippling statistically significant values (p-values).

condition

Inequality operator to be applied considering the given threshold. "GT" = greater than the value of threshold, "GE" = greater or equal, "LT" = lower than, "LE" = lower or equal than. Default to "LT" (see the rationale in the next argument).

...

Further optional style arguments (see the examples).

Details

The function generates a "sp.points" layout list. Further formatting arguments can be passed here. For further details and examples see the help of spplot.

Value

A list with a SpatialPoints object, along with optional style arguments like col, pch, cex etc., to be passed to the sp.layout argument in spatialPlot.

Author(s)

J. Bedia

See Also

spatialPlot, to which its output is passed. map.lines, for further map customizations.

Examples


require(climate4R.datasets)
require(transformeR)
data("CFS_Iberia_tas")
p90clim <- climatology(CFS_Iberia_tas,
                       by.member = FALSE,
                       clim.fun = list("FUN" = quantile, prob = .9))
spatialPlot(p90clim, backdrop.theme = "coastline",
                main = "CFSv2 Ensemble mean Tmean 90th percentile (July 2001)")

# We want to highlight the grid points with a 90th percentile > 25.5 degrees, 
# on top of the Tmean model climatology:
pts <- map.stippling(p90clim, threshold = 15.5, condition = "GT")
spatialPlot(climatology(CFS_Iberia_tas),
                backdrop.theme = "coastline",
                sp.layout = list(pts))

# Some useful parameters that can be passed to the layout list:
pts <- map.stippling(p90clim, threshold = 15.5, condition = "GT",
                     pch = 19, # dots instead of default crosses
                     col = "black", # black dots
                     cex = .1) # point expansion factor (to make them very small)
spatialPlot(climatology(CFS_Iberia_tas),
                backdrop.theme = "coastline",
                sp.layout = list(pts))

# Suppose we want the stippling just in the first and fifth panels, for instance:
pts <- map.stippling(p90clim, threshold = 15.5, condition = "GT",
                     pch = 19, col = "black", cex = .1,
                     which = c(1, 5)) # which controls in which panel(s) the points are displayed
spatialPlot(climatology(CFS_Iberia_tas),
                backdrop.theme = "coastline",
                sp.layout = list(pts))


SantanderMetGroup/visualizeR documentation built on Oct. 28, 2023, 6:11 a.m.