DateListPlot

DateListPlot[{{date1,v1},{date2,v2},}]
plots points with values at a sequence of dates.

DateListPlot[{v1,v2,},datespec]
plots points with dates at equal intervals specified by datespec.

DateListPlot[{list1,list2,}]
plots several lists of values.

Details and OptionsDetails and Options

  • DateListPlot[list] by default plots each value in list as a separate point.
  • DateListPlot[list,Joined->True] draws a line through the list of points. »
  • Possible forms of include: »
  • tabsolute time given as a single number
    {y,m,d,h,m,s}DateList specification
    {y}, , , shortened date list
    "string"DateString specification
  • In shortened date lists, omitted elements are taken to have default values .
  • Possible forms of datespec include: »
  • {start,end}dates from start to end in equal steps
    {start,Automatic,step}dates beginning with start in steps step
    {Automatic,end,step}dates ending with end in steps step
    startdates with steps determined by the form of start
  • The step in datespec can be a date list specification or any of the special forms , , , , , , , , . »
  • If no explicit step is given, the step used will be the smallest time unit specified explicitly in start.
  • DateListPlot has the same options as ListPlot, with the following additions and changes:
  • AxesAutomaticwhether to include axes
    DateFunctionAutomatichow to convert dates to standard form
    DateTicksFormatAutomaticformat for date tick labels
    FrameTruewhether to put a frame around the plot
    PlotRangeAutomaticrange of values to include
  • All explicit coordinates in Prolog, Epilog, Ticks, etc. are taken to be dates. »

ExamplesExamplesopen allclose all

Basic Examples  (5)Basic Examples  (5)

Plot data with explicit date values:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Plot monthly values, starting in August 2000:

In[1]:=
Click for copyable input
Out[1]=

Join the points:

In[1]:=
Click for copyable input
Out[1]=

Plot multiple datasets with a legend:

In[1]:=
Click for copyable input
Out[1]=

Retrieve and plot a historical stock price:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2007
(6.0)
| Updated in 2014
(10.0)