Function Repository Resource:

DateListPlotRanged

Source Notebook

Plot a time series that includes shading to indicate ranges in the plotted value

Contributed by: Stephen Wolfram

ResourceFunction["DateListPlotRanged"][series]

plots a time series containing data of the form {value,{min,max}}.

Examples

Basic Examples (1) 

Plot a series of values that include ranges:

In[1]:=
ResourceFunction[
 "DateListPlotRanged"][<|DateObject[{1994, 7, 1}, "Day", "Gregorian", -4.`] -> {1.68, {1.3, 2.1}}, DateObject[{2006, 2, 9}, "Day", "Gregorian", -4.`] -> {2.6, {1.7, 3.}}, DateObject[{2006, 3, 16}, "Day", "Gregorian", -4.`] -> {1.8, {1.8, 2.5}}, DateObject[{2006, 8, 23}, "Day", "Gregorian", -4.`] -> {2., {1.8, 2.5}}, DateObject[{2007, 12, 1}, "Day", "Gregorian", -4.`] -> {2.3, {1.7, 3.}}, DateObject[{2011, 11, 1}, "Day", "Gregorian", -4.`] -> {2., {1, 3.2}}, DateObject[{2019, 5, 18}, "Day", "Gregorian", -4.`] -> {1.8, {1.6, 2.6}}|>]
Out[1]=

Scope (1) 

If a range is omitted, it will not be plotted:

In[2]:=
ResourceFunction[
 "DateListPlotRanged"][<|DateObject[{1994, 7, 1}, "Day", "Gregorian", -4.`] -> {1.68, {1.3, 2.1}}, DateObject[{2003, 2, 9}, "Day", "Gregorian", -5.`] -> {2.6, {1.7, 2.4}}, DateObject[{2006, 3, 16}, "Day", "Gregorian", -4.`] -> {1.8, {1.8, 2.5}}, DateObject[{2007, 12, 1}, "Day", "Gregorian", -4.`] -> {2.3}, DateObject[{2008, 8, 23}, "Day", "Gregorian", -5.`] -> {2., {1.8, 2.5}}, DateObject[{2011, 11, 1}, "Day", "Gregorian", -4.`] -> {2., {1, 3.2}}, DateObject[{2019, 5, 18}, "Day", "Gregorian", -4.`] -> {1.8, {1.6, 2.6}}|>]
Out[2]=

Version History

  • 1.0.0 – 23 July 2019

Author Notes

This needs to be made more robust, in particular accepting more types of input allowed by DateListPlot.

License Information