我在Julia繪製時間序列時遇到問題。繪製時間序列Julia
我目前用V 0.6及以下小例子
using TimeSeries
using MarketData
plot(ohlcv["Open"])
導致的ErrorMessage:
ArgumentError: Millisecond: 63082540800000 out of range (0:999)
請幫
非常感謝!
我在Julia繪製時間序列時遇到問題。繪製時間序列Julia
我目前用V 0.6及以下小例子
using TimeSeries
using MarketData
plot(ohlcv["Open"])
導致的ErrorMessage:
ArgumentError: Millisecond: 63082540800000 out of range (0:999)
請幫
非常感謝!
這是一個0.6版相關的錯誤 - 它現在已經修復,並且原始問題中的代碼再次運行。
看起來像一個錯誤。
現在,你可以通過轉換爲浮動,雖然治療的日期作爲標籤得到一個體面的情節:
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!爲Plots.jl)
@Hamlet我的榮幸。如果答案解決了您的問題,請將其標記爲已接受,以便將其從未解答的問題列表中刪除。歡迎來到這裏:) –
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)
(?這劇情包/後端您使用) –
我用的地塊,但PyPlot也未嘗不可! – Hamlet