plotAnnualAnomaly: Plot annual time series

View source: R/plot.R

plotAnnualAnomalyR Documentation

Plot annual time series

Description

Creates a time-series of annual time series in the format that is used for

Usage

plotAnnualAnomaly(
  x,
  y,
  ysc,
  xlim,
  ylim,
  xlab = TRUE,
  climatologyYears,
  ylabel = TRUE,
  plotSd = TRUE,
  yaxs = TRUE,
  plotPoints = TRUE,
  plotRunningAvg = TRUE,
  plotLmTrend = FALSE,
  lmResults,
  plotClimatologyMean = FALSE,
  climatologyMean,
  plotScorecard = FALSE,
  scorecardLines = TRUE,
  scorecardLabels = TRUE,
  scorecardSeparation = par("cin")[2],
  scorecardWidth = par("cin")[2]
)

Arguments

x

a vector indicating the times of observations

y

a vector indicating the observations

ysc

a vector indicating observations used for scorecard, ignored if plotScorecard = FALSE

xlim

Optional limit for x axis

ylim

Optional limit for y axis

xlab

Logical indicating whether to label the x axis

climatologyYears

Vector of length two indicating the climatology years, ignored if plotSd = FALSE.

ylabel

Logical indicating whether to label the y axis

plotSd

Logical indicating whether to add +/- 0.5 standard deviation lines on plot of the annual anomaly over the defined climatology period.

yaxs

Logical indicating whether to have a labelled y-axis

plotPoints

Logical indicating whether or not to plot points on top of line

plotRunningAvg

Logical indicating whether or not to plot a 5 year running average

plotLmTrend

Logical indicating whether or not to print out results of a linear regression on the plot

lmResults

A lm format object, if plotLmTrend = FALSE, ignored.

plotClimatologyMean

Logical indicating whether or not to print out the climatology mean.

climatologyMean

A numeric value, if plotClimatologyMean = FALSE, ignored.

plotScorecard

Logical indicating whether or not to plot scorecard on side = 1.

scorecardLines

Logical indicating whether or not to put vertical lines on scorecard.

scorecardLabels

Logical indicating whether or not to print ysc values in scorecard.

scorecardSeparation

Value used to denote the separation between the main plot and scorecard. Suggested to use par('cin')[2] (default) and play with that value. If closer is desired, decrease.

scorecardWidth

Value used to denote the width of the scorecard. Suggested to use par('cin')[2] (default) and play with that value. If wider is desired, increase.

Details

The current format of the figure is for the 2019 research document. Any changes in the future will be reflected in the code with comments, and here.

  • 2019 - Annual anomalies are plotted with a grey line and a 5-year running mean plotted over top in black. Thick dashed horizonal lines of the standard deviation of the annual climatology are added. Code has been written to ensure that at least one century is labelled.

Author(s)

Chantelle Layton


clayton33/csasMarPhys documentation built on June 8, 2025, 3:10 a.m.