0

我正在制作高频价格数据的时间序列图。我的时间序列在上午 8 点到下午 4 点之间有每秒的报价,但跳过了晚上和周末。我怎样才能从我的情节中省略这些差距,以使每天的价格序列似乎“粘合”在一起。

回答:

谢谢,@Shai!我选择了这样的东西:

% price, year, month, day, hour, minute, second are all column vectors of equal length
% exactly N price quotes per trading day (8am-4pm, excluding weekends)
date = datenum([year, month, day, hour, minute, second]);
price = price;
figure;
plot(price);
tick_index = 1:N:length(date); % my ticks are placed at the start of each trading day
tick_label = datestr(date(tick_index), 6);
set(gca, 'XTick', tick_index);
set(gca, 'XTickLabel', tick_label);

我对回答问题很陌生——如果我违反了礼仪,请告诉我!

4

1 回答 1

1

您可以控制XTick绘图的 s 以隐藏间隙。请参阅此文档

于 2013-05-06T20:26:13.187 回答