View source: R/addLockdownRect.R
addLockdownRect | R Documentation |
addLockdownRect
adds rectangles around the periods specified as dates or date times on a plot
where the x-axis is a date or datetime. Be sure to specify from & to as dates if the plot x-axis is
a date and as dateTimes if it is a dateTime. Otherwise ggplot will throw a date_trans error.addLockdownRect
adds rectangles around the periods specified as dates or date times on a plot
where the x-axis is a date or datetime. Be sure to specify from & to as dates if the plot x-axis is
a date and as dateTimes if it is a dateTime. Otherwise ggplot will throw a date_trans error.
addLockdownRect( p, from, to, label, yMin, yMax, alpha = 0.1, fill = "grey50", colour = "red" )
p |
the plot to add them to |
from |
the start date/datetime |
to |
the end dat dat/datetime |
label |
the label to display |
yMin |
the smallest y value |
yMax |
the largest y value |
alpha |
- alpha value for the rect (0.1) |
fill |
- fill for the rect (grey50) |
colour |
- line colour for the rect (red) |
Ben Anderson, b.anderson@soton.ac.uk (original)
Other plot:
createDailyMeanComparePlot()
,
createDailyPcComparePlot()
,
createRecentDateTimePlot()
,
createRecentHalfHourlyProfilePlot()
,
makeWeekdayPlot()
,
makeWeekdayTimePlot()
Other utils:
addSeason()
,
alignDates()
,
getDuration()
,
gzipFile()
,
loadLibraries()
,
nzCalculateCO2e()
,
setPeakPeriod()
,
setup()
,
tidyNum()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.