DateListStepPlot[{{date1,y1},{date2,y2},…}]
分步绘制在一个日期序列上的数值 yi.
DateListStepPlot[{y1,y2,…},datespec]
分步绘制数值 yi,其中日期按 datespec 的规定等间隔分布.
DateListStepPlot[tseries]
绘制时间序列 tseries.
DateListStepPlot[{data1,data2,…}]
从全部的 datai 绘制数据.
DateListStepPlot[…,step]
按 step 指定的步长绘图.
DateListStepPlot[{…,w[datai],…}]
绘制数据 datai 及其由符号式封装 w 定义的特性.
DateListStepPlot
DateListStepPlot[{{date1,y1},{date2,y2},…}]
分步绘制在一个日期序列上的数值 yi.
DateListStepPlot[{y1,y2,…},datespec]
分步绘制数值 yi,其中日期按 datespec 的规定等间隔分布.
DateListStepPlot[tseries]
绘制时间序列 tseries.
DateListStepPlot[{data1,data2,…}]
从全部的 datai 绘制数据.
DateListStepPlot[…,step]
按 step 指定的步长绘图.
DateListStepPlot[{…,w[datai],…}]
绘制数据 datai 及其由符号式封装 w 定义的特性.
更多信息和选项
- DateListStepPlot 在绘制数据时会确使每个点都成为水平阶梯的一部分,包括第一个和最后一个数据点.
- datei 的可能形式包括:
-
DateObject[…],TimeObject[…] 日期或时间对象 "string" DateString 规范 {y,m,d,h,m,s} DateList 规范 {y},{y,m},{y,m,d},… 短日期列表 t 用单个数字给出的绝对时间 - 在缩写的日期列表中,省略的元素将采用默认值 {y,1,1,0,0,0}.
- datespec 的可能形式包括:
-
{start,end} 日期从 start 到 end 等量增加 {start,Automatic,Δt} 日期从 start 开始按 Δt 增加 {Automatic,end,Δt} 日期到 end 结束按 Δt 增加 start 由 start 的形式决定日期增量 - datespec 中的 Δt 可以是 {y,m,d,h,m,s} 日期列表规范或特殊形式 "Year"、"Quarter"、"Month"、"Week"、"Day"、"Hour"、"Minute"、"Second" 及 "Millisecond" 中的任意一种.
- 如果没有明确指定 Δt,则使用 start 中明确指定的最小时间单位作为增量.
- 可以给出下列 step 规范:
-

Right 阶梯向右延伸 
Left 阶梯向左延伸 
Center 阶梯向相邻两点之间的中点延伸 - 可以用下列形式给出数据值 yi:
-
yi 实值数 Quantity[yi,unit] 带单位的量 - 不具有上述形式的值 yi 被认为是缺失数据,在曲线中显示为空白缺口.
- listi 具有下列形式及解释:
-
<|"k1"y1,"k2"y2,…|> 值 {y1,y2,…} SparseArray 普通数组 TimeSeries, EventSeries 时间-数值对 QuantityArray 数量值 w[datai] 数据集 datai 的封装 w - DateListStepPlot[Tabular[…]cspec] 用列指定 cspec 从表格对象中提取值并绘制.
- 可使用以下形式的列指定 cspec 来绘制表格数据:
-
{colx,coly} 相对于 x 列数据绘制 y 列数据 {{colx1,coly1},{colx2,coly2},…} 相对于 x1 列数据绘制 y1 列数据,y2 相对于 x2, … coly, {coly} 以序列形式绘制 y 列的值 {{coly1},…,{colyi},…} 以序列形式绘制 y1, y2, … 列的值 - colx 也可以是 Automatic,在这种情况下,用 DataRange 生成序列的值.
- DateListStepPlot[TimeSeries[…]cspec] 和 DateListStepPlot[EventSeries[…]cspec]用分量指定 cspec 从时间或事件序列中提取值并绘制.
- 可使用以下形式的分量指定 cspec 来绘制序列数据:
-
com 绘制分量 com 与时间戳 {com1,com2,…} 绘制每个分量 comi 与时间戳 - 可将下列封装 w 用于 listi:
-
Annotation[datai,label] 提供注释 Button[datai,action] 定义当曲线被点击时应执行的操作 Callout[datai,label] 用呼唤点标注数据 EventHandler[datai,…] 定义曲线的一般事件处理程序 Highlighted[datai,effect] 动态突出显示 fi 的效果 Highlighted[datai,Placed[effect,pos]] 静态突出显示 fi 在位置 pos 的效果 Hyperlink[datai,uri] 把曲线变为一个超链接 Labeled[e,…] 显示带标签的曲线 Legended[datai,…] 在图例中标识曲线 PopupWindow[datai,cont] 在曲线上附加一个弹出窗口 StatusArea[datai,label] 当鼠标悬停于曲线上时在状态栏中显示 Style[datai,opts] 用指定样式显示曲线 Tooltip[datai,label] 在曲线上添加任意提示条 - DateListStepPlot 接受和 Graphics 一样的选项,并具有下列增加和改变: [所有选项的列表]
- 在单个绘图面板中显示多条曲线的 PlotLayout 的可能设置包括:
-

"Overlaid" 重叠显示所有数据 
"Stacked" 堆置数据 
"Percentile" 堆置并归一化数据 - 默认设置 Joined->True 下,各阶梯由垂直线段相连. 当设置为 Joined->False 时只画出阶梯.
- PlotStylesty 指定每条曲线使用的样式. 可能的设置包括:
-
{sty1,sty2,…} 针对每个数据集的一系列样式 <|"key"val,…|> 针对不同层级的数据的样式元素 - 接受的键有:
-
"Base" 所有 datai 的整体样式 "Lists" 针对每个 datai 的样式 styi 的列表 - ColorData["DefaultPlotColors"] 给出 PlotStyle 使用的默认颜色序列.
- 使用 Mesh->Full 绘制除阶梯之外的点.
- ScalingFunctions->"scale" 缩放
坐标;ScalingFunctions{"scalex","scaley"} 同时缩放
和
坐标. - 在 Prolog、Epilog、Ticks 等里面的所有显式
坐标都被认为是日期. - Highlighted 和 PlotHighlighting 的可能突出显示效果包括:
-

style 突出显示指定的曲线 
"Ball" 突出显示并标注曲线中的指定点 
"Dropline" 突出显示并标注曲线中的指定点,并在轴线上标出垂线 
"XSlice" 突出显示并标记沿垂直切面的所有点 
"YSlice" 突出显示并标记沿水平切面的所有点 
Placed[effect,pos] 静态突出显示给定位置 pos - 突出显示位置规约 pos 包括:
-
x, {x} {x,y} 处的效果,其中 y 为自动选择 {x,y} {x,y} 处的效果 {pos1,pos2,…} 多个位置 posi
所有选项的列表
范例
打开所有单元 关闭所有单元基本范例 (5)
data = {{DateObject[{2006, 10, 1}, "Day", "Gregorian", -6.], 10}, {DateObject[{2006, 10, 15}, "Day", "Gregorian", -6.], 12}, {DateObject[{2006, 10, 30}, "Day", "Gregorian", -6.], 15}, {DateObject[{2006, 11, 20}, "Day", "Gregorian", -6.], 20}};DateListStepPlot[data]DateListStepPlot[data, Center, Mesh -> Full]DateListStepPlot[{1, 2, 3, 4, 5, 6, 7}, {2000, 8}]DateListStepPlot[TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> True, "Count" -> 10,
"Endpoints" -> TabularColumn[Association[
"Data" -> {2, {{NumericArray[{15706, -2147483648}, "Integer32"], {},
DataStructure["BitVe ... 7, 34, 40, 49, 54, 64, 72}, {}, None},
"ElementType" -> "Integer64"]], TabularColumn[Association[
"Data" -> {{1, 9, 11, 16, 18, 25, 34, 43, 49, 54}, {}, None},
"ElementType" -> "Integer64"]]}}]]]], Association[]] -> "a", PlotLabels -> Automatic]data1 = TimeSeries[{1, 1, 2, 3, 5, 8, 11}, {"Jan 1, 2015"}];
data2 = TimeSeries[{5, 8, 9, 6, 2, 4, 7}, {"Jan 1, 2015"}];DateListStepPlot[{data1, data2}, PlotLegends -> {"first", "second"}]DateListStepPlot[{data1, data2}, PlotLabels -> {"first", "second"}]DateListStepPlot[TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], Joined -> False]范围 (49)
数据 (13)
data = {{DateObject[{2006, 10, 1}, "Day", "Gregorian", -6.], 10}, {DateObject[{2006, 10, 15}, "Day", "Gregorian", -6.], 12}, {DateObject[{2006, 10, 30}, "Day", "Gregorian", -6.], 15}, {DateObject[{2006, 11, 20}, "Day", "Gregorian", -6.], 20}};DateListStepPlot[data]DateListStepPlot[TemporalData[TimeSeries, {{{6.464000015258789, 6.367999992370605, 6.333333298012063,
6.5071428162711005, 6.407142843518939, 6.37333329518636, 6.466666645473904, 6.421052681772332,
6.427272666584361, 6.484615362607515, 6.285714285714286, 6 ... Data`DateSpecification[{2010, 1, 17, 20, 45, 32.},
{2013, 12, 17, 20, 45, 32}, {1, "Month"}]}, 1, {"Continuous", 1}, {"Discrete", 1}, 1,
{ValueDimensions -> 1, ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True,
10.3]]DateListStepPlot[TemporalData[EventSeries, {{{6.464000015258789, 6.367999992370605, 6.333333298012063,
6.5071428162711005, 6.407142843518939, 6.37333329518636, 6.466666645473904, 6.421052681772332,
6.427272666584361, 6.484615362607515, 6.285714285714286, ... 6.5,
6.199999809265137}}, {TemporalData`DateSpecification[{2010, 1, 17, 20, 45, 32.},
{2013, 12, 17, 20, 45, 32}, {1, "Month"}]}, 1, {"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> None, ValueDimensions -> 1}}, True, 10.3]]DateListStepPlot[{2, 3, 5, 7, 11, 13, 17}, DateObject[{2015, 8, 15}, "Day", "Gregorian", -6.]]DateListStepPlot[Sqrt[Range[10]], {DateObject[{2006, 5, 5}, "Day", "Gregorian", -6.], DateObject[{2006, 5, 30}, "Day", "Gregorian", -6.]}]DateListStepPlot[Range[5], {DateObject[{2006, 1, 15}, "Day", "Gregorian", -6.], Automatic, "Month"}]以 DateString 规范给出的日期:
DateListStepPlot[{{"June 2006", 10}, {"August 2006", 12}, {"November 2006", 15}, {"January 2007", 20}}]用 AbsoluteTime 规范给出的日期:
DateListStepPlot[{{3368649600, 10}, {3369859200, 12}, {3371155200, 15}, {3372969600, 20}}]data1 = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];
data2 = TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];DateListStepPlot[{data1, data2}]DateListStepPlot[TemporalData[TimeSeries, {{{6.464000015258789, 6.367999992370605, 6.333333298012063,
6.5071428162711005, 6.407142843518939, 6.37333329518636, 6.466666645473904, 6.421052681772332,
6.427272666584361, 6.484615362607515, 6.285714285714286, 6 ... Data`DateSpecification[{2010, 1, 17, 20, 45, 32.},
{2013, 12, 17, 20, 45, 32}, {1, "Month"}]}, 1, {"Continuous", 1}, {"Discrete", 1}, 1,
{ValueDimensions -> 1, ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True,
10.3]]绘制 TimeSeries 或 EventSeries 中的所有数据:
DateListStepPlot[TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {7, {{NumericArray[{-248, 118, 298, 638, 865, 1006, 1216}, "Integer32"], {},
None}}, None}, ... "Data" -> {{32, 62, 112, 167, 179, 209, 214}, {}, None}, "ElementType" -> "Integer64"]],
TabularColumn[Association["Data" -> {{30, 49, 81, 125, 142, 174, 177}, {}, None},
"ElementType" -> "Integer64"]]}}]]]], Association[]]]绘制 TimeSeries 或 EventSeries 的特定分量:
trees = TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {7, {{NumericArray[{-248, 118, 298, 638, 865, 1006, 1216}, "Integer32"], {},
None}}, None}, ... "Data" -> {{32, 62, 112, 167, 179, 209, 214}, {}, None}, "ElementType" -> "Integer64"]],
TabularColumn[Association["Data" -> {{30, 49, 81, 125, 142, 174, 177}, {}, None},
"ElementType" -> "Integer64"]]}}]]]], Association[]];DateListStepPlot[trees -> "tree 1"]DateListStepPlot[trees -> {"tree 1", "tree 2"}]用 PlotRange 专注于感兴趣的区域:
DateListStepPlot[TemporalData[TimeSeries, {{{6.464000015258789, 6.367999992370605, 6.333333298012063,
6.5071428162711005, 6.407142843518939, 6.37333329518636, 6.466666645473904, 6.421052681772332,
6.427272666584361, 6.484615362607515, 6.285714285714286, 6 ... Data`DateSpecification[{2010, 1, 17, 20, 45, 32.},
{2013, 12, 17, 20, 45, 32}, {1, "Month"}]}, 1, {"Continuous", 1}, {"Discrete", 1}, 1,
{ValueDimensions -> 1, ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True,
10.3], PlotRange -> {{"Jan 1, 2011", "Dec 31, 2011"}, {6.2, 6.6}}]用 ScalingFunctions 缩放坐标轴:
DateListStepPlot[{229, 627, 53, 1432, 931, 184}, Today, ScalingFunctions -> "Log"]表格数据 (1)
tab = Tabular[IconizedObject[«Country populations»]]DateListStepPlot[tab -> {"Date", "France"}]DateListStepPlot[tab -> {{"Date", "France"}, {"Date", "Germany"}, {"Date", "Australia"}}]DateListStepPlot[tab -> {{"Date", "France"}, {"Date", "Germany"}, {"Date", "Australia"}}, PlotLegends -> {"France", "Germany", "Australia"}]特殊数据 (6)
用 Quantity 包含数据及单位:
DateListStepPlot[Quantity[Sqrt[Range[10]], "Meters"], {2010, 1, 1}, FrameLabel -> Automatic]绘制 QuantityArray 中的数据:
qa = QuantityArray[RandomReal[{0, 40}, 20], "Fahrenheit"]DateListStepPlot[qa, {2000, 1, 1}, FrameLabel -> Automatic]用 TargetUnits 指定使用的单位:
DateListStepPlot[qa, {2000, 1, 1}, TargetUnits -> "Kelvin", FrameLabel -> Automatic]Association 中的数值值被用作
坐标:
DateListStepPlot[<|"a" -> 2, "b" -> 3, "c" -> 5, "d" -> 7, "e" -> 11, "f" -> 13|>, "Jan, 1, 2010"]Association 中的数值键和值被用作
和
坐标:
DateListStepPlot[<|2 -> 1, 3 -> 2, 5 -> 3, 7 -> 4, 11 -> 5, 13 -> 6|>]直接绘制 TimeSeries:
data = CountryData["UnitedStates", {{"Population"}, {1988, 2013}}]DateListStepPlot[data, FrameLabel -> Automatic]WeightedData 中的权重被忽略:
DateListPlot[WeightedData[{2, 3, 5, 7, 11, 13, 17, 19, 23, 29}, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}], {2010, 1, 1}]DateListStepPlot[SparseArray[i_ /; PrimeQ[i] :> i, 20], DateObject[{2015, 7, 31}, "Day", "Gregorian", -6.]]封装 (8)
{DateListStepPlot[{Style[{1, 2, 3}, Green], {4, 5, 6}}, {2014, 8}], DateListStepPlot[Style[{{1, 2, 3}, {4, 5, 6}}, Blue], {2014, 8}]}DateListStepPlot[Style[{Style[{1, 2, 3}, Green], {4, 5, 6}}, Blue], {2014, 8}]DateListStepPlot[Tooltip[Prime[Range[10]]], {2014, 8}, Center, Mesh -> Full]DateListStepPlot[Tooltip[Prime[Range[10]], "primes"], {2014, 8}, Center, Mesh -> Full]利用 PopupWindow 提供额外的深入信息:
DateListStepPlot[{1, PopupWindow[2, DateListPlot[FinancialData["IBM", "Jan. 1, 2004"]]], 3}, {2004, 1}, Center, Mesh -> Full, PlotStyle -> PointSize[0.05]]可以利用 Button 来触发任意动作:
DateListStepPlot[{1, Button[2, Speak[2]], 3}, {2014, 8}, Center, Mesh -> Full, PlotStyle -> PointSize[0.05]]将 Annotation 用于当鼠标进入绘图区时的动态动作:
data = TemporalData[TimeSeries, {{{7, 12, 15, 20}}, {{{3368649600, 3369859200, 3371155200, 3372969600}}},
1, {"Continuous", 1}, {"Discrete", 1}, 1, {ValueDimensions -> 1, DateFunction -> Automatic,
ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];{DateListStepPlot[Annotation[data, "label", "Mouse"]], Dynamic[MouseAnnotation[]]}当曲线被点击时,利用 Hyperlink 跳到指定的链接:
data = TemporalData[TimeSeries, {{{7, 12, 15, 20}}, {{{3368649600, 3369859200, 3371155200, 3372969600}}},
1, {"Continuous", 1}, {"Discrete", 1}, 1, {ValueDimensions -> 1, DateFunction -> Automatic,
ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];DateListStepPlot[Hyperlink[data, "http://www.wolfram.com"]]利用 StatusArea 在当前笔记本的状态区显示字符串:
data = TemporalData[TimeSeries, {{{7, 12, 15, 20}}, {{{3368649600, 3369859200, 3371155200, 3372969600}}},
1, {"Continuous", 1}, {"Discrete", 1}, 1, {ValueDimensions -> 1, DateFunction -> Automatic,
ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];DateListStepPlot[StatusArea[data, "String"]]标签和图例 (15)
用 Labeled 给数据添加标签:
data1 = Accumulate@RandomInteger[10, 10];data2 = Accumulate@RandomInteger[3, 10];DateListStepPlot[{Labeled[data1, "label1"], Labeled[data2, "label2"]}, {2010, 1, 1}]用 PlotLabels 给数据添加标签:
data1 = Accumulate@RandomInteger[10, 10];data2 = Accumulate@RandomInteger[3, 10];DateListStepPlot[{data1, data2}, {2000}, PlotLabels -> {"label1", "label2"}]DateListStepPlot[Labeled[Accumulate@RandomInteger[10, 10], "label", {2004}], {2000}]DateListStepPlot[Labeled[Accumulate@RandomInteger[10, 10], "label", Scaled[0.3]], {2000}]DateListStepPlot[Labeled[Accumulate@RandomInteger[10, 10], "label", {Scaled[0.3], Below}], {2000}]DateListStepPlot[Table[Labeled[RandomReal[], i], {i, 15}], {2010, 1, 1}, PlotMarkers -> Automatic]Table[DateListStepPlot[Table[Labeled[RandomReal[], i, p], {i, 6}], {2010, 1, 1}, PlotMarkers -> Automatic, PlotLabel -> p], {p, {Above, Below, Before, After}}]data = Rule[TimeSeries[{1, 1, 2, 3, 5, 8, 11}, {"Jan 1, 2015"}], RandomWord[7]];DateListStepPlot[data, LabelingSize -> 30]DateListStepPlot[data, LabelingSize -> Full]data = Rule[TimeSeries[RandomReal[1, 100], {"Jan 1, 2015"}], RandomWord[100]];DateListStepPlot[data, PlotMarkers -> Automatic]DateListStepPlot[data, ImageSize -> 400, PlotMarkers -> Automatic]用 Callout 自动给数据添加标签:
DateListStepPlot[{Callout[{2, 6, 10, 15, 15, 20, 24, 27, 27, 28}, "label1"], Callout[{1, 2, 3, 3, 4, 4, 4, 4, 5, 5}, "label2"]}, {2015, 1}]DateListStepPlot[Callout[Table[n ^ Sin[n], {n, 1, 10, 0.25}], "label", Above], {2014, 1}]data1 = Accumulate@RandomInteger[10, 20];data2 = Accumulate@RandomInteger[3, 20];DateListStepPlot[{data1, data2}, {2000}, PlotLegends -> {"company1", "company2"}]用 Legended 为指定数据集提供图例:
data1 = Accumulate@RandomInteger[10, 20];data2 = Accumulate@RandomInteger[3, 20];DateListStepPlot[{data1, data2, Legended[data1 - data2, "difference"]}, {200}]用 Placed 改变图例位置:
DateListStepPlot[{data1, data2, Legended[data1 - data2, Placed["difference", Bottom]]}, {200}]data1 = Accumulate@RandomInteger[10, 20];data2 = Accumulate@RandomInteger[3, 20];DateListStepPlot[<|"company A" -> data1, "company B" -> data2|>, {2000}, PlotLabels -> Automatic, PlotLegends -> None]当你把鼠标移到绘图上方时,绘图通常有显示坐标的交互式callout:
DateListStepPlot[Range[15], {2007}]DateListStepPlot[Callout[Range[15], "hello", "01/01/2012"], {2007}]用 Highlighted 强调图中特定的点:
DateListStepPlot[Highlighted[Range[15], Placed["Ball", DateObject[{2014, 1, 1}]]], {2007}]用 Highlighted[…,None] 禁止对一组点进行突出显示:
DateListStepPlot[{Range[10], Highlighted[2 * Range[10], None]}, {2007}]外观 (6)
data1 = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];
data2 = TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];DateListStepPlot[{data1, data2}]DateListStepPlot[{data1, data2}, PlotStyle -> {Dashed, Red}]DateListStepPlot[{data1, data2}, PlotLegends -> {a, b}]用 Legended 为指定数据集提供图例:
DateListStepPlot[{Legended[data1, "data 1"], Legended[data2, "data 2"]}]为曲线添加交互式 Tooltip:
data = TemporalData[TimeSeries, {{{7, 12, 15, 20}}, {{{3368649600, 3369859200, 3371155200, 3372969600}}},
1, {"Continuous", 1}, {"Discrete", 1}, 1, {ValueDimensions -> 1, DateFunction -> Automatic,
ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];DateListStepPlot[Tooltip[data, "Label"], Mesh -> Full]DateListStepPlot[Tooltip[{{DateObject[{2006, 10, 1}, TimeObject[{0, 0, 0.}, TimeZone -> -5.], TimeZone -> -5.], 7}, {DateObject[{2006, 10, 15}, TimeObject[{0, 0, 0.}, TimeZone -> -5.], TimeZone -> -5.], 12}, {DateObject[{2006, 10, 30}, TimeObject[{0, 0, 0.}, TimeZone -> -5.], TimeZone -> -5.], 15}, {DateObject[{2006, 11, 20}, TimeObject[{0, 0, 0.}, TimeZone -> -5.], TimeZone -> -5.], 20}}], Mesh -> Full]data1 = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];
data2 = TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];DateListStepPlot[{data1, data2}, Filling -> Axis]DateListStepPlot[{TemporalData[...], TemporalData[...]}, Center, Mesh -> Full, PlotMarkers -> Automatic]DateListStepPlot[{TemporalData[...], TemporalData[...]}, PlotTheme -> "Web"]DateListStepPlot[{TemporalData[...], TemporalData[...]}, PlotTheme -> "Marketing"]data1 = {{DateObject[{2016, 10, 1}, "Day", "Gregorian", -5.], 10}, {DateObject[{2016, 10, 15}, "Day", "Gregorian", -5.], 17}, {DateObject[{2016, 10, 30}, "Day", "Gregorian", -5.], 15}, {DateObject[{2016, 11, 20}, "Day", "Gregorian", -5.], 20}};data2 = {{DateObject[{2016, 10, 1}, "Day", "Gregorian", -5.], 15}, {DateObject[{2016, 10, 15}, "Day", "Gregorian", -5.], 7}, {DateObject[{2016, 10, 30}, "Day", "Gregorian", -5.], 12}, {DateObject[{2016, 11, 20}, "Day", "Gregorian", -5.], 10}};DateListStepPlot[{data1, data2}, PlotLayout -> "Stacked"]选项 (119)
AspectRatio (4)
DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1]]DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], AspectRatio -> 1 / 2]通过 AspectRatio1 使高等和宽度相等:
DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], AspectRatio -> 1]AspectRatioFull 调整高度和宽度以便可以恰当地放在其他结构的里面:
plot = DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], AspectRatio -> Full];{Framed[Pane[plot, {50, 100}]], Framed[Pane[plot, {100, 100}]], Framed[Pane[plot, {100, 50}]]}Axes (1)
默认情况下,DateListStepPlot 使用边框,而不是坐标轴:
data = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];DateListStepPlot[data]DateListStepPlot[data, Frame -> False, Axes -> True]DateListStepPlot[data, Frame -> False, Axes -> {True, False}]DateListStepPlot[data, Frame -> False, Axes -> {False, True}]AxesLabel (4)
DateListStepPlot[TimeSeries[QuantityArray[Range[10], "Meters"], {"Jan 10,2021"}], Frame -> False, Axes -> True]DateListStepPlot[TimeSeries[QuantityArray[Range[10], "Meters"], {"Jan 10,2021"}], Frame -> False, Axes -> True, AxesLabel -> label]DateListStepPlot[TimeSeries[QuantityArray[Range[10], "Meters"], {"Jan 10,2021"}], Frame -> False, Axes -> True, AxesLabel -> {"Date", "Number"}]DateListStepPlot[TimeSeries[QuantityArray[Range[10], "Meters"], {"Jan 10,2021"}], Axes -> True, Frame -> False, AxesLabel -> Automatic]AxesOrigin (1)
DateListStepPlot[TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 8, 3, 0, 0, 0.}, {2015, 8, 9, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2], Frame -> False]DateListStepPlot[TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 8, 3, 0, 0, 0.}, {2015, 8, 9, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2], Frame -> False, AxesOrigin -> {"August 1, 2015", 0}]AxesStyle (1)
data = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];DateListStepPlot[data, Frame -> False, Axes -> True, AxesStyle -> Red]DateListStepPlot[data, Frame -> False, Axes -> True, AxesStyle -> {{Thick, Red}, {Thick, Blue}}]DateListStepPlot[data, Frame -> False, Axes -> True, AxesStyle -> Green, TicksStyle -> Red]DateListStepPlot[data, Frame -> False, Axes -> True, AxesStyle -> Green, LabelStyle -> Red]ClippingStyle (1)
data = TemporalData[TimeSeries, {{{161.60000038146973, 159.19999980926514, 170.99999904632568,
91.09999942779541, 89.69999980926514, 95.59999942779541, 116.39999961853027,
122.00000095367432, 70.69999933242798, 84.2999997138977, 44., 85.09999990 ... Data`DateSpecification[{2010, 1, 17, 20, 45, 32.}, {2013, 12, 17, 20, 45, 32},
{1, "Month"}]}, 1, {"Continuous", 1}, {"Discrete", 1}, 1,
{ValueDimensions -> 1, ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True,
10.3];DateListStepPlot[data, ClippingStyle -> None]DateListStepPlot[data, ClippingStyle -> Red]DateListStepPlot[data, PlotRange -> All]ColorFunction (4)
data = TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];DateListStepPlot[data, ColorFunction -> "Rainbow"]data = TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];DateListStepPlot[data, ColorFunction -> Function[{x, y}, Hue[x]]]DateListStepPlot[data, ColorFunction -> Function[{x, y}, Hue[y]]]data = TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];DateListStepPlot[data, ColorFunction -> Function[{x, y}, Hue[x]], Filling -> Axis]在为曲线着色时,ColorFunction 比 PlotStyle 的优先级更高:
data = TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];DateListStepPlot[data, ColorFunction -> "DarkRainbow", PlotStyle -> Directive[Red, Dashed]]ColorFunctionScaling (2)
data = TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];DateListStepPlot[data, ColorFunction -> Function[{x, y}, Hue[y]], PlotStyle -> Thick, ColorFunctionScaling -> True]data = TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];DateListStepPlot[data, ColorFunction -> Function[{x, y}, Hue[y / 25]], PlotStyle -> Thick, ColorFunctionScaling -> False]DateFunction (1)
默认情况下,用数字表示的时间对应于 AbsoluteTime:
data = {{100000000, 2}, {200000000, 3}, {300000000, 5}, {400000000, 7}, {500000000, 11}, {600000000, 13}, {700000000, 17}, {800000000, 19}, {900000000, 23}, {1000000000, 29}, {1100000000, 31}, {1200000000, 37}};DateListStepPlot[data]将其解释为 UnixTime:
DateListStepPlot[data, DateFunction -> FromUnixTime]DateTicksFormat (1)
data = TemporalData[TimeSeries, {{{10, 12, 15}}, {{{3.3607008*^9, 3.3645888*^9, 3.3663168*^9}}}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1, {ValueDimensions -> 1, DateFunction -> Automatic,
ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];Table[DateListStepPlot[data, DateTicksFormat -> f], {f, {"MonthShort", "Month", "MonthNameShort", "MonthName"}}]Filling (2)
data = TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];Table[DateListStepPlot[data, Filling -> c], {c, {Top, Bottom, Axis, 5}}]data1 = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];
data2 = TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];DateListStepPlot[{data1, data2}, Filling -> Axis]DateListStepPlot[{data1, data2}, Filling -> {2 -> {1}}]DateListStepPlot[{data1, data2}, Filling -> {2 -> {{1}, LightGray}}]FillingStyle (3)
data = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];DateListStepPlot[data, Filling -> Axis, FillingStyle -> Red]DateListStepPlot[data, Filling -> Axis, FillingStyle -> {Red, Blue}]data1 = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];
data2 = TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];DateListStepPlot[{data1, data2}, Filling -> Axis, FillingStyle -> Directive[Opacity[0.5], Orange]]使用 ColorFunction 中可变的填充样式:
data = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 8, 1, 0, 0, 0.}, {2015, 8, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];DateListStepPlot[data, ColorFunction -> Function[{x, y}, Hue[y]], Filling -> Axis, FillingStyle -> Automatic]Frame (4)
默认情况下,DateListStepPlot 显示边框:
DateListStepPlot[Range[10], {2007}]DateListStepPlot[Range[10], {2007}, Frame -> False]DateListStepPlot[Range[10], {2007}, Frame -> {{True, True}, {False, False}}]DateListStepPlot[Range[10], {2007}, Frame -> {{True, False}, {True, False}}]FrameLabel (4)
DateListStepPlot[Range[10], {2007}, FrameLabel -> {"label"}]DateListStepPlot[Range[10], {2007}, FrameLabel -> {"Bottom", "Left"}]DateListStepPlot[Range[10], {2007}, FrameLabel -> {{"left", "right"}, {"bottom", "top"}}]DateListStepPlot[Range[10], {2007}, FrameLabel -> {{"left", "right"}, {"bottom", "top"}}, LabelStyle -> Directive[Bold, StandardGreen]]FrameStyle (2)
DateListStepPlot[Range[10], {2007}, FrameStyle -> Directive[StandardGreen, Thick]]DateListStepPlot[Range[10], {2007}, FrameStyle -> {{Directive[StandardGreen, Thick], Directive[Red, Thick]}, {Directive[Gray, Thick], Directive[Blue, Thick]}}]FrameTicks (9)
DateListStepPlot[Range[10], {2007}]DateListStepPlot[Range[10], {2007}, FrameTicks -> None]DateListStepPlot[Range[10], {2007}, FrameTicks -> {{None, None}, {Automatic, None}}]DateListStepPlot[Range[10], {2007}, FrameTicks -> Automatic]用 All 在所有边框处显示刻度的标签:
DateListStepPlot[Range[10], {2007}, FrameTicks -> All]DateListStepPlot[Range[10], {2007}, FrameTicks -> {{{2, .5, 10}, None}, {{"July 1, 2011", "July 1, 2014"}, None}}]DateListStepPlot[Range[10], {2007}, FrameTicks -> {{{{2, "two"}, {5, "five"}, {10, "ten"}}, None}, {{{"July 1, 2011", "date 1"}, {"July 1, 2014", "date 2"}}, None}}]DateListStepPlot[Range[10], {2007}, FrameTicks -> {{{{2, "two", .15}, {5, "five", .45}, {10, "ten", .95}}, None}, {Automatic, None}}]DateListStepPlot[Range[10], {2007}, FrameTicks -> {{{{2, "two", {.15, .1}}, {5, "five", {.45, .2}}, {10, "ten", {.95, .3}}}, None}, {Automatic, None}}]DateListStepPlot[Range[10], {2007}, FrameTicks -> {{{{2, "two", .12, Directive[Blue, Thick]}, {5, "five", .4, Directive[Red, Thick, Dashed]}, {10, "ten", .9, Directive[Green, Thick, Dashed]}}, None}, {Automatic, None}}]minMeanMax[min_, max_] := {{min, min}, {(max + min) / 2, (max + min) / 2}, {max, max}}DateListStepPlot[Range[10], {2007}, FrameTicks -> {{minMeanMax, None}, {Automatic, None}}, PlotRangePadding -> None]FrameTicksStyle (3)
DateListStepPlot[Range[10], {2007}, FrameStyle -> Directive[Red]]DateListStepPlot[Range[10], {2007}, FrameStyle -> Directive[Red], FrameTicksStyle -> Directive[Blue, Thick]]DateListStepPlot[Range[10], {2007}, FrameTicks -> All, FrameTicksStyle -> {{Directive[Orange, Thick], Blue}, {Red, Green}}]GridLines (1)
data = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 8, 1, 0, 0, 0.}, {2015, 8, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];DateListStepPlot[data, GridLines -> Automatic]DateListStepPlot[data, GridLines -> {{"Aug 2, 2015", "Aug 6, 2015"}, None}]GridLinesStyle (1)
data = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];DateListStepPlot[data, GridLines -> Automatic, GridLinesStyle -> Dotted]ImageSize (7)
使用已命名尺寸,如 Tiny、Small、Medium 和 Large:
{DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], ImageSize -> Tiny], DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], ImageSize -> Small]}{DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], ImageSize -> 150], DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], AspectRatio -> 1.5, ImageSize -> 150]}{DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], ImageSize -> {Automatic, 150}], DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], AspectRatio -> 2, ImageSize -> {Automatic, 150}]}{DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], ImageSize -> UpTo[200]], DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], AspectRatio -> 2, ImageSize -> UpTo[200]]}DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], ImageSize -> {200, 200}, Background -> StandardGray]设置 AspectRatioFull 将填充可用空间:
DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], AspectRatio -> Full, ImageSize -> {200, 200}, Background -> StandardGray]{DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], ImageSize -> {UpTo[150], UpTo[100]}], DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], AspectRatio -> 2, ImageSize -> {UpTo[150], UpTo[100]}]}Framed[Pane[DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], ImageSize -> Full, Background -> StandardGray], {200, 100}]]Framed[Pane[DateListStepPlot[TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1], ImageSize -> {Scaled[0.5], Scaled[0.5]}, Background -> StandardGray], {200, 100}]]Joined (1)
data = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];DateListStepPlot[data]DateListStepPlot[data, Joined -> False]LabelingSize (4)
DateListPlot[TimeSeries[{1, 1, 2, 3, 5, 8}, {"Jan 1, 2015"}] -> {"healthfulness", "obstreperous", "spectrogram", "vestige", "coinage", "limey"}, ImageSize -> Medium]DateListStepPlot[TimeSeries[{1, 1, 2, 3, 5, 8}, {"Jan 1, 2015"}] -> {[image], [image], [image], [image], [image], [image]}, ImageSize -> Medium]DateListStepPlot[TimeSeries[{1, 1, 2, 3, 5, 8}, {"Jan 1, 2015"}] -> {"healthfulness", "obstreperous", "spectrogram", "vestige", "coinage", "limey"}, ImageSize -> Medium, LabelingSize -> 30]DateListStepPlot[TimeSeries[{1, 1, 2, 3, 5, 8}, {"Jan 1, 2015"}] -> {[image], [image], [image], [image], [image], [image]}, ImageSize -> Medium, LabelingSize -> 20]DateListStepPlot[TimeSeries[{1, 1, 2, 3, 5, 8}, {"Jan 1, 2015"}] -> {[image], [image], [image], [image], [image], [image]}, ImageSize -> Medium, LabelingSize -> Full]Mesh (1)
data = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];DateListStepPlot[data, Mesh -> Full]Table[DateListStepPlot[data, step, Mesh -> Full, PlotLabel -> step], {step, {Left, Right, Center}}]Table[DateListStepPlot[data, Mesh -> m, PlotLabel -> Mesh -> m], {m, {All, 15, None, Automatic}}]MeshFunctions (1)
在
方向(红色)上显示七个节点,在
方向(蓝色)上显示十个节点:
data = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 8, 1, 0, 0, 0.}, {2015, 8, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];DateListStepPlot[data, Center, Mesh -> {7, 10}, MeshFunctions -> {#1&, #2&}, MeshStyle -> {Directive[PointSize[Medium], Red], Blue}]MeshShading (1)
data = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];DateListStepPlot[data, Mesh -> 15, MeshFunctions -> {#1&}, MeshShading -> {Red, Blue}]MeshShading 可与 PlotStyle 一起使用:
DateListStepPlot[data, Mesh -> 15, PlotStyle -> Dashed, MeshFunctions -> {#1&}, MeshShading -> {Red, Blue}]MeshStyle (1)
data = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 8, 1, 0, 0, 0.}, {2015, 8, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 10.2];DateListStepPlot[data, Mesh -> Full, MeshStyle -> Red]PlotFit (4)
DateListStepPlot[TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 94.28900146484375, 95.00199890136719, 92.56099700927734, 90.25, 90.35600280761719}, {},
None}}, None}, "ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]], PlotFit -> Automatic]DateListStepPlot[TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 94.28900146484375, 95.00199890136719, 92.56099700927734, 90.25, 90.35600280761719}, {},
None}}, None}, "ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]], PlotFit -> "Linear"]DateListStepPlot[TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 94.28900146484375, 95.00199890136719, 92.56099700927734, 90.25, 90.35600280761719}, {},
None}}, None}, "ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]], PlotFit -> "Quadratic"]DateListStepPlot[TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 94.28900146484375, 95.00199890136719, 92.56099700927734, 90.25, 90.35600280761719}, {},
None}}, None}, "ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]], PlotFit -> PeriodicModel[3]]//QuietPlotFitElements (2)
DateListStepPlot[TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 94.28900146484375, 95.00199890136719, 92.56099700927734, 90.25, 90.35600280761719}, {},
None}}, None}, "ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]], PlotFit -> Automatic, PlotFitElements -> "BandCurves"]DateListStepPlot[TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 94.28900146484375, 95.00199890136719, 92.56099700927734, 90.25, 90.35600280761719}, {},
None}}, None}, "ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]], PlotFit -> Automatic, PlotFitElements -> {"BandCurves", <|"ConfidenceLevel" -> 0.5|>}]DateListStepPlot[TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 94.28900146484375, 95.00199890136719, 92.56099700927734, 90.25, 90.35600280761719}, {},
None}}, None}, "ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]], PlotFit -> Automatic, PlotFitElements -> "Residuals"]DateListStepPlot[TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 94.28900146484375, 95.00199890136719, 92.56099700927734, 90.25, 90.35600280761719}, {},
None}}, None}, "ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]], PlotFit -> Automatic, PlotFitElements -> {"DataPoints", {"Residuals", <|"Style" -> Opacity[1, StandardRed]|>}}]PlotHighlighting (9)
默认设定 PlotHighlightingAutomatic,可使绘图中有交互式 callout:
DateListStepPlot[Range[10], {2007}]用 PlotHighlightingNone 禁止突出显示整个绘图:
DateListStepPlot[Range[10], {2007}, PlotHighlighting -> None]DateListPlot[{Range[10], 2 * Range[10]}, {2007}, PlotHighlighting -> Directive[Red, AbsolutePointSize[10], DropShadowing[]]]DateListStepPlot[{Range[10], 2 * Range[10]}, {2007}, PlotHighlighting -> "Dropline"]DateListStepPlot[Range[10], {2007}, PlotHighlighting -> "Dropline"]DateListStepPlot[Range[10], {2007}, PlotHighlighting -> Placed["Dropline", DateObject[{2012, 1, 1}]]]DateListStepPlot[{Range[10], 2 * Range[10]}, {2007}, PlotHighlighting -> "XSlice"]DateListStepPlot[Range[10], {2007}, PlotHighlighting -> Placed["XSlice", DateObject[{2014, 1, 1}]]]DateListStepPlot[{Range[10], 2 * Range[10]}, {2007}, PlotHighlighting -> "YSlice"]DateListStepPlot[{Range[10], 2 * Range[10]}, {2007}, PlotHighlighting -> Placed["YSlice", 4]]DateListStepPlot[{Range[10], 2 * Range[10]}, {2007}, PlotHighlighting -> "XNearestPoint"]DateListStepPlot[{Range[10], 2 * Range[10]}, {2007}, PlotHighlighting -> {"XNearestPoint", <|"Style" -> StandardGray|>}]DateListStepPlot[{Range[10], 2 * Range[10]}, {2007}, PlotHighlighting -> "XYLabel"]用 Callout 选项来改变标签的外观:
DateListStepPlot[{Range[10], 2 * Range[10]}, {2007}, PlotHighlighting -> {"XYLabel", <|"Appearance" -> "Corners", "CalloutMarker" -> "Circle"|>}]DateListStepPlot[{Range[10], 2 * Range[10]}, {2007}, PlotHighlighting -> {{"XNearestPoint", <|"Style" -> StandardGray|>}, {"XYLabel", <|"Appearance" -> "Corners", "CalloutMarker" -> "Circle"|>}}]DateListStepPlot[{Range[10], 2 * Range[10]}, {2007}, PlotHighlighting -> {"XYLabel", <|"NumberForm" -> 4, "LabelingFunction" -> (Grid[{{"x", First[#1]}, {"y", Last[#1]}}]&)|>}]PlotInteractivity (3)
DateListStepPlot[{2, 3, 5, 7, 11, 13, 17, 19, 23, 29}, Today]DateListStepPlot[{2, 3, 5, 7, 11, 13, 17, 19, 23, 29}, Today, PlotInteractivity -> False]DateListStepPlot[{2, 3, 5, 7, 11, 13, 17, 19, 23, Tooltip[29, "hello"]}, Today, PlotMarkers -> Automatic, PlotInteractivity -> <|"User" -> True, "System" -> False|>]PlotLabel (1)
PlotLabels (4)
data1 = Transpose[{DateRange[{2000, 1, 1}, {2000, 1, 15}], RandomReal[10, 15]}];data2 = Transpose[{DateRange[{2000, 1, 1}, {2000, 1, 15}], RandomReal[10, 15]}];DateListStepPlot[{data1, data2}, PlotLabels -> {"label1", "label2"}]ge = FinancialData["GE", {{2015, 1, 1}, {2015, 1, 20}}];DateListStepPlot[ge, PlotLabels -> Placed["high", Above]]DateListStepPlot[ge, PlotLabels -> Placed["crisis", {{2015, 1, 15}, Below}]]PlotLabels->Automatic 使用关联中的键作为数据标签:
DateListStepPlot[<|"a" -> Accumulate@RandomInteger[10, 10], "b" -> Accumulate@RandomInteger[10, 10]|>, {2007}, PlotLabels -> Automatic, PlotLegends -> None]用 None 不添加标签:
data1 = Transpose[{DateRange[{2000, 1, 1}, {2000, 1, 15}], Accumulate@RandomReal[10, 15]}];
data2 = Transpose[{DateRange[{2000, 1, 1}, {2000, 1, 15}], Accumulate@RandomReal[3, 15]}];DateListStepPlot[{data1, data2}, PlotLabels -> {"label1", None}]PlotLayout (1)
data1 = {{DateObject[{2016, 10, 1}, "Day", "Gregorian", -5.], 10}, {DateObject[{2016, 10, 15}, "Day", "Gregorian", -5.], 17}, {DateObject[{2016, 10, 30}, "Day", "Gregorian", -5.], 15}, {DateObject[{2016, 11, 20}, "Day", "Gregorian", -5.], 20}};data2 = {{DateObject[{2016, 10, 1}, "Day", "Gregorian", -5.], 15}, {DateObject[{2016, 10, 15}, "Day", "Gregorian", -5.], 7}, {DateObject[{2016, 10, 30}, "Day", "Gregorian", -5.], 12}, {DateObject[{2016, 11, 20}, "Day", "Gregorian", -5.], 10}};DateListStepPlot[{data1, data2}]DateListStepPlot[{data1, data2}, PlotLayout -> "Stacked"]PlotLegends (1)
DateListStepPlot[{TemporalData[...], TemporalData[...]}, PlotLegends -> {"one", "two"}]DateListStepPlot[{TemporalData[...], TemporalData[...]}, PlotStyle -> {Red, Blue}, PlotLegends -> {"one", "two"}]DateListStepPlot[{TemporalData[...], TemporalData[...]}, PlotStyle -> {Red, Blue}, PlotLegends -> Placed[{"one", "two"}, {0.3, 0.7}]]PlotMarkers (2)
用 PlotMarkers->Automatic 显示每个台阶的数据点:
data = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];DateListStepPlot[data, PlotMarkers -> Automatic]Table[DateListStepPlot[data, step, PlotMarkers -> Automatic, PlotLabel -> step], {step, {Right, Left, Center}}]data1 = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];
data2 = TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];
data3 = TemporalData[TimeSeries, {{{3, 5, 7, 11, 13, 17}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 6, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];DateListStepPlot[{data1, data2, data3}, PlotMarkers -> Automatic]DateListStepPlot[{data1, data2, data3}, Center, PlotMarkers -> {▲, ●, "Y"}, Joined -> False]DateListStepPlot[{data1, data2, data3}, Center, PlotMarkers -> "▲", Joined -> False, Mesh -> Full]PlotRange (1)
PlotRange 是自动计算的:
data = TemporalData[TimeSeries, {{{161.60000038146973, 159.19999980926514, 170.99999904632568,
91.09999942779541, 89.69999980926514, 95.59999942779541, 116.39999961853027,
122.00000095367432, 70.69999933242798, 84.2999997138977, 44., 85.09999990 ... Data`DateSpecification[{2010, 1, 17, 20, 45, 32.}, {2013, 12, 17, 20, 45, 32},
{1, "Month"}]}, 1, {"Continuous", 1}, {"Discrete", 1}, 1,
{ValueDimensions -> 1, ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True,
10.3];DateListStepPlot[data]DateListStepPlot[data, PlotRange -> All]DateListStepPlot[data, PlotRange -> {{"Nov 1, 2011", "Mar 31, 2012"}, {0, 100}}]PlotStyle (4)
DateListStepPlot[TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 648438, 173.49000549316406, 173.5500030517578,
180.1199951171875, 175.52999877929688}, {}, None}}, None},
"ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]], PlotStyle -> StandardRed]DateListStepPlot[{TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 648438, 173.49000549316406, 173.5500030517578,
180.1199951171875, 175.52999877929688}, {}, None}}, None},
"ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]], TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 94.28900146484375, 95.00199890136719, 92.56099700927734, 90.25, 90.35600280761719}, {},
None}}, None}, "ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]]}]DateListStepPlot[{TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 648438, 173.49000549316406, 173.5500030517578,
180.1199951171875, 175.52999877929688}, {}, None}}, None},
"ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]], TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 94.28900146484375, 95.00199890136719, 92.56099700927734, 90.25, 90.35600280761719}, {},
None}}, None}, "ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]]}, PlotStyle -> {StandardBlue, StandardGreen}]DateListStepPlot[{TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 648438, 173.49000549316406, 173.5500030517578,
180.1199951171875, 175.52999877929688}, {}, None}}, None},
"ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]], TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 94.28900146484375, 95.00199890136719, 92.56099700927734, 90.25, 90.35600280761719}, {},
None}}, None}, "ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]]}, PlotStyle -> <|"Base" -> AbsoluteThickness[1]|>]DateListStepPlot[{TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 648438, 173.49000549316406, 173.5500030517578,
180.1199951171875, 175.52999877929688}, {}, None}}, None},
"ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]], TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 94.28900146484375, 95.00199890136719, 92.56099700927734, 90.25, 90.35600280761719}, {},
None}}, None}, "ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]]}, PlotStyle -> <|"Lists" -> {StandardOrange, StandardMagenta}|>]DateListStepPlot[{TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 648438, 173.49000549316406, 173.5500030517578,
180.1199951171875, 175.52999877929688}, {}, None}}, None},
"ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]], TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> False,
"Timestamps" -> TabularColumn[Association[
"Data" -> {61, {{NumericArray[{19724, 19725, 19726, 19727, 19730, 19731, 19732, 19733, 19734,
19738, ... 94.28900146484375, 95.00199890136719, 92.56099700927734, 90.25, 90.35600280761719}, {},
None}}, None}, "ElementType" -> TypeSpecifier["Quantity"]["Real64", "USDollars"]]],
Association["ResamplingMethod" -> "LinearInterpolation"]]}, PlotStyle -> <|"Base" -> AbsoluteThickness[1], "Lists" -> {StandardOrange, StandardMagenta}|>]PlotTheme (1)
data1 = TemporalData[TimeSeries, {{{1, 1, 2, 3, 5, 8, 11}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];
data2 = TemporalData[TimeSeries, {{{5, 8, 9, 6, 2, 4, 7}},
{TemporalData`DateSpecification[{2015, 1, 1, 0, 0, 0.}, {2015, 1, 7, 0, 0, 0}, {1, "Day"}]}, 1,
{"Continuous", 1}, {"Discrete", 1}, 1,
{ResamplingMethod -> {"Interpolation", InterpolationOrder -> 1}}}, True, 314.1];DateListStepPlot[{data1, data2}, PlotTheme -> "Business"]DateListStepPlot[{data1, data2}, PlotTheme -> "Business", PlotStyle -> {StandardRed, StandardBlue}]DateListStepPlot[{data1, data2}, PlotTheme -> "Minimal"]ScalingFunctions (7)
DateListStepPlot[TimeSeries[{1, 1, 4, 9, 25, 64, 121}, {"Jan 1, 2015"}]]DateListStepPlot[TimeSeries[{1, 1, 4, 9, 25, 64, 121}, {"Jan 1, 2015"}], ScalingFunctions -> "Log"]DateListStepPlot[TimeSeries[{1, 1, 4, 9, 25, 64, 121}, {"Jan 1, 2015"}], ScalingFunctions -> "Reverse"]DateListStepPlot[TimeSeries[{1, 1, 2, 3, 5, 8, 11}, {"Jan 1, 2015"}], ScalingFunctions -> "Reciprocal"]DateListStepPlot[TimeSeries[{1, 1, 4, 9, 25, 64, 121}, {"Jan 1, 2015"}], ScalingFunctions -> {-Log[#]&, Exp[-#]&}]在 FrameTicks 和 GridLines 中的位置是自动缩放的:
DateListStepPlot[TimeSeries[{1, 1, 4, 9, 25, 64, 121}, {"Jan 1, 2015"}], ScalingFunctions -> "Log", FrameTicks -> {Automatic, 2 ^ Range[0, 10]}, GridLines -> {None, 2 ^ Range[0, 10]}]PlotRange 是自动缩放的:
DateListStepPlot[TimeSeries[{1, 1, 4, 9, 25, 64, 121}, {"Jan 1, 2015"}], ScalingFunctions -> "Log", PlotRange -> {0.5, 500}]Ticks (9)
DateListStepPlot[Range[10], {2007}, Axes -> True, Frame -> False]DateListStepPlot[Range[10], {2007}, Frame -> False, Axes -> True, Ticks -> {None, None}]DateListStepPlot[Range[10], {2007}, Frame -> False, Axes -> True, Ticks -> {Automatic, None}]DateListStepPlot[Range[10], {2007}, Frame -> False, Axes -> True, Ticks -> {{"July 1, 2011", "July 1, 2014"}, {2, 3, 5, 7, 9}}]DateListStepPlot[Range[10], {2007}, Frame -> False, Axes -> True, Ticks -> {{{"July 1, 2011", "year 1"}, {"July 1, 2014", "year 2"}}, {{2, "two"}, {5, "five"}, {9, "nine"}}}]DateListStepPlot[Range[10], {2007}, Frame -> False, Axes -> True, Ticks -> {{{"July 1, 2011", "year 1"}, {"July 1, 2014", "year 2"}}, Automatic}]DateListStepPlot[Range[10], {2007}, Frame -> False, Axes -> True, Ticks -> {{{"July 1, 2011", "a", .25}, {"July 1, 2014", "b", .45}}, Automatic}]DateListStepPlot[Range[10], {2007}, Frame -> False, Axes -> True, Ticks -> {{{"July 1, 2011", "a", {.27, .1}}, {"July 1, 2014", "b", {.45, .2}}}, Automatic}]DateListStepPlot[Range[10], {2007}, Frame -> False, Axes -> True, Ticks -> {{{"July 1, 2011", "a", .29, Directive[Blue, Thick]}, {"July 1, 2014", "b", .45, Directive[StandardGray, Thick, Dashed]}}, Automatic}]minMeanMax[min_, max_] := {{min, min}, {(max + min) / 2, (max + min) / 2}, {max, max}}DateListStepPlot[Range[10], {2007}, Frame -> False, Axes -> True, Ticks -> {Automatic, minMeanMax}, PlotRangePadding -> None]TicksStyle (4)
DateListStepPlot[Range[10], {2007}, Frame -> False, Axes -> True, AxesStyle -> Red]DateListStepPlot[Range[10], {2007}, Frame -> False, Axes -> True, TicksStyle -> Directive[Red]]DateListStepPlot[Range[10], {2007}, Frame -> False, Axes -> True, TicksStyle -> {Directive[StandardGreen, Thick], Directive[Blue, Thick]}]DateListStepPlot[Range[10], {2007}, Frame -> False, Axes -> True, TicksStyle -> Directive[Red, Thick], LabelStyle -> Blue]TargetUnits (1)
DateListStepPlot[{Quantity[1, "Meters"], Quantity[1, "Meters"], Quantity[2, "Meters"], Quantity[3, "Meters"], Quantity[5, "Meters"], Quantity[8, "Meters"], Quantity[11, "Meters"]}, {DateObject[{2015, 1, 1}], Automatic, "Month"}, FrameLabel -> Automatic]DateListStepPlot[{Quantity[1, "Meters"], Quantity[1, "Meters"], Quantity[2, "Meters"], Quantity[3, "Meters"], Quantity[5, "Meters"], Quantity[8, "Meters"], Quantity[11, "Meters"]}, {DateObject[{2015, 1, 1}], Automatic, "Month"}, FrameLabel -> Automatic, TargetUnits -> "Feet"]应用 (7)
DateListStepPlot[{0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0}, {{2015, 1, 1}, Automatic, "Milliseconds"}, AxesOrigin -> {Automatic, -0.5}, AspectRatio -> 1 / 10, Frame -> False, Ticks -> {Automatic, {0, 1}}]DateListStepPlot[{Accumulate@{180, 40, 50, 70, 100, 60, 70}, Accumulate@{30, 80, 50, 70, 50, 50, 110}}, {{2015, 1, 1}, Automatic, "Days"}, Center, Filling -> {2 -> {1}}, PlotLegends -> {"stock", "sales"}, AxesLabel -> {None, "Items"}]显示波士顿爱德华·劳伦斯·洛根将军国际机场从 2000 年 1 月 1 号到 2005 年 12 月 31 号的总降水量:
DateListStepPlot[WeatherData["KBOS", "TotalPrecipitation", {{2000, 1, 1}, {2005, 12, 31}, "Month"}], Joined -> True]分步绘制法国从 1985 年到 2005 年的 GDP 数据:
DateListStepPlot[CountryData["France", {{"GDP"}, {1985, 2005}}]]ts = TemporalData[TimeSeries, {{{6., 6.300000190734863, 6.599999904632568, 6.5, 7.199999809265137,
7.199999809265137, 6.099999904632568, 6.800000190734863, 6.800000190734863, 6.900000095367432,
6.900000095367432, 6.900000095367432, 6., 6.19999 ... 896, 3593856774, 3593869244,
3594181712, 3594349654, 3594849854, 3594868197, 3596312288}}}, 1, {"Continuous", 1},
{"Discrete", 1}, 1, {ValueDimensions -> 1, ResamplingMethod ->
{"Interpolation", InterpolationOrder -> 1}}}, True, 10.];DateListPlot[ts]DateListStepPlot[TimeSeriesAggregate[ts, "Month"]]path = Accumulate[Prepend[RandomReal[ExponentialDistribution[0.5], 30], 0]];data = Transpose[{path, Range[Length[path]]}];DateListStepPlot[data]data = RandomFunction[QueueingProcess[3 / 3600, 5 / 3600], {0, 15 * 3600}]DateListStepPlot[data, Filling -> Axis]属性和关系 (4)
DateListStepPlot 不在数值间进行插值:
data = CountryData["France", {{"GDP"}, {1985, 2005}}];DateListStepPlot[data]用 DateListPlot 在数值间进行线性插值:
DateListPlot[data]DateListPlot[data, InterpolationOrder -> 3]ListStepPlot 不会将
值解释为日期或时间:
data = {{1, 10}, {2, 12}, {3, 15}, {4, 20}};{ListStepPlot[data], DateListStepPlot[data]}DateListStepPlot 绘制和日期相关的数值:
data = {DateObject[{2015, 6, 10}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 26}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 15}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 25}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 23}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 19}, "Day", "Gregorian", -6.], DateObject[{2015, 5, 31}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 6}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 4}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 16}, "Day", "Gregorian", -6.], DateObject[{2015, 5, 29}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 4}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 14}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 3}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 14}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 6}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 10}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 19}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 20}, "Day", "Gregorian", -6.], DateObject[{2015, 6, 21}, "Day", "Gregorian", -6.]};DateListStepPlot[Tally[data]]用 DateHistogram 绘制各个日期的频数:
DateHistogram[data, "Day"]用 TradingChart 绘制每个日期的价钱和交易量:
data = FinancialData["IBM", "OHLCV", {{2009, 5, 1}, {2009, 6, 1}}];TradingChart[data]文本
Wolfram Research (2015),DateListStepPlot,Wolfram 语言函数,https://reference.wolfram.com/language/ref/DateListStepPlot.html (更新于 2026 年).
CMS
Wolfram 语言. 2015. "DateListStepPlot." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2026. https://reference.wolfram.com/language/ref/DateListStepPlot.html.
APA
Wolfram 语言. (2015). DateListStepPlot. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/DateListStepPlot.html 年
BibTeX
@misc{reference.wolfram_2026_dateliststepplot, author="Wolfram Research", title="{DateListStepPlot}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/DateListStepPlot.html}", note=[Accessed: 05-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_dateliststepplot, organization={Wolfram Research}, title={DateListStepPlot}, year={2026}, url={https://reference.wolfram.com/language/ref/DateListStepPlot.html}, note=[Accessed: 05-September-2026]}