plot_red_blue: Plot the red/blue style of anomaly plot, linearly...

View source: R/plot-pacea-index.R

plot_red_blueR Documentation

Plot the red/blue style of anomaly plot, linearly interpolating to make smooth (needed when crossing x-axis); internal function called from 'plot-pacea_index()'.

Description

Adapted from https://stackoverflow.com/questions/74902499/shading-below-line-graph-in-r/74903305#74903305 and interpolated.

Usage

plot_red_blue(obj_lub, value, xlab, ylab, type, ...)

Arguments

obj_lub

obj a 'pacea_index' object, which is a time series, with a date column that is the lubridate 'date' class.

value

which column of 'obj' to plot

xlab

x-axis label

ylab

y-axis label, the default is an attribute of the 'pacea_index' object.

type

usual argument for 'plot()'

...

optional arguments passed onto 'plot()'. Note that the x-axis is constructed using a lubridate 'date' object, so 'xlim' needs to be a 'date' object (see example).

Value

plot of time series

Author(s)

Andrew Edwards

Examples

## Not run: 
# see plot.pacea_index()

## End(Not run)

pbs-assess/PACea documentation built on April 17, 2025, 11:36 p.m.