ADX图形不清楚

时间:2019-12-24 14:35:04

标签: python matplotlib

我必须为给定的数据集计算ADX然后将其绘制出来。该数据集由2秒钟的仪器烛台组成,持续5天。我已经从excel验证了ADX的值,并且该值即将发布是正确的。但是我得到的图不符合获得的值。 最终绘图的代码是

plt.plot(timestamp[29:len(closing_values)],ADX[29:len(closing_values)])

obtained graph

1 个答案:

答案 0 :(得分:0)

我很确定问题出在您的日期上。确保它们是matlab序列日期或日期时间。

% function to convert matlab serial dates to yyymmdd format
serial2yyyymmdd = @(seryl) datevec(seryl)*[1e4 1e2 1 0 0 0]';

dta = randn(300,1);

figure;
subplot(2,1,1)
% plot with yyyymmdd dates
plot(serial2yyyymmdd(today-299:today),dta)
title('plot with yyyymmdd dates')
subplot(2,1,2)
% plot with matlab serial dates
plot(today-299:today,dta)
title('plot with matlab serial dates')

enter image description here