Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

axisIntervals

Mark Intervals on a Plot Axis


Description

Adds an axis (axisintervals) or two axes (axesIntervals) to the current plot with tick marks delimiting interval described by labels

Usage

axisIntervals(side=1, atTick1=fda::monthBegin.5, atTick2=fda::monthEnd.5,
      atLabels=fda::monthMid, labels=month.abb, cex.axis=0.9, ...)
axesIntervals(side=1:2, atTick1=fda::monthBegin.5, atTick2=fda::monthEnd.5,
      atLabels=fda::monthMid, labels=month.abb, cex.axis=0.9, las=1, ...)

Arguments

side

an integer specifying which side of the plot the axis is to be drawn on. The axis is placed as follows: 1=below, 2=left, 3=above and 4=right.

atTick1

the points at which tick-marks marking the starting points of the intervals are to be drawn. This defaults to 'monthBegin.5' to mark monthly periods for an annual cycle. These are constructed by calling axis(side, at=atTick1, labels=FALSE, ...). For more detail on this, see 'axis'.

atTick2

the points at which tick-marks marking the ends of the intervals are to be drawn. This defaults to 'monthEnd.5' to mark monthly periods for an annual cycle. These are constructed by calling axis(side, at=atTick2, labels=FALSE, ...). Use atTick2=NA to rely only on atTick1. For more detail on this, see 'axis'.

atLabels

the points at which 'labels' should be typed. These are constructed by calling axis(side, at=atLabels, tick=FALSE, ...). For more detail on this, see 'axis'.

labels

Labels to be typed at locations 'atLabels'. This is accomplished by calling axis(side, at=atLabels, labels=labels, tick=FALSE, ...). For more detail on this, see 'axis'.

cex.axis

Character expansion (magnification) used for axis annotations ('labels' in this function call) relative to the current setting of 'cex'. For more detail, see 'par'.

las

line axis style; see par.

...

additional arguments passed to axis.

Value

The value from the third (labels) call to 'axis'. This function is usually invoked for its side effect, which is to add an axis to an already existing plot.

axesIntervals calls axisIntervals(side[1], ...) then axis(side[2], ...).

Side Effects

An axis is added to the current plot.

Author(s)

Spencer Graves

See Also

Examples

daybasis65 <- create.fourier.basis(c(0, 365), 65)

daytempfd <- with(CanadianWeather, smooth.basis(
       day.5,  dailyAv[,,"Temperature.C"], 
       daybasis65, fdnames=list("Day", "Station", "Deg C"))$fd )

with(CanadianWeather, plotfit.fd(
      dailyAv[,,"Temperature.C"], argvals=day.5,
          daytempfd, index=1, titles=place, axes=FALSE) )
# Label the horizontal axis with the month names
axisIntervals(1)
axis(2)
# Depending on the physical size of the plot,
# axis labels may not all print.
# In that case, there are 2 options:
# (1) reduce 'cex.lab'.
# (2) Use different labels as illustrated by adding
#     such an axis to the top of this plot

with(CanadianWeather, plotfit.fd(
      dailyAv[,,"Temperature.C"], argvals=day.5,
          daytempfd, index=1, titles=place, axes=FALSE) )
# Label the horizontal axis with the month names
axesIntervals()

axisIntervals(3, labels=monthLetters, cex.lab=1.2, line=-0.5)
# 'line' argument here is passed to 'axis' via '...'

fda

Functional Data Analysis

v5.1.9
GPL (>= 2)
Authors
J. O. Ramsay <ramsay@psych.mcgill.ca> [aut,cre], Spencer Graves <spencer.graves@effectivedefense.org> [ctb], Giles Hooker <gjh27@cornell.edu> [ctb]
Initial release
2020-12-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.