我在朱莉娅绘制时间序列时遇到了问题。
我目前正在使用v.6.6和以下最小例子
using TimeSeries
using MarketData
plot(ohlcv["Open"])
导致错误消息:
ArgumentError:毫秒:63082540800000超出范围(0:999)
请帮忙
非常感谢!
答案 0 :(得分:1)
好像是一个错误。
现在,您可以通过转换为Float并将日期视为标签来获得一个不错的情节:
using TimeSeries, MarketData, PyPlot
O = ohlcv["Open"];
Timestamps = [Float64(t) for t in O.timestamp];
Timestamplabels = [string(t) for t in O.timestamp];
plot(Timestamps, O.values);
xticks(Timestamps[1:div(end,4):end], Timestamplabels[1:div(end,4):end]);
<子> PS。你没有指定你正在使用的情节后端,所以我假设这个例子是PyPlot。你的xtick方法可能因其他后端而异(例如xticks!for Plots.jl)
答案 1 :(得分:0)
这是Plots中与0.6相关的错误 - 它现在已修复,原始问题中的代码再次起作用。
答案 2 :(得分:0)
Temporal是另一个具有绘图功能的时间序列包。 (它使用RecipesBase与Plots包集成)。下面的一些示例用法:
using Temporal
X = quandl("CHRIS/CME_CL1") # get historical crude oil prices
x = X["2015/", :Settle] # get the settle prices from 2015 onward
using Plots
plotlyjs()
plot(x)
using Indicators
m = mama(x) # mesa adaptive moving average
plot!(m)