How to remove missing/non existing days in a graph?

조회 수: 7 (최근 30일)
Pierre Lonfat
Pierre Lonfat 2018년 3월 12일
답변: dpb 2018년 3월 12일
The documentation I have found on the forum is only about removing the NaN which is not my case.
Here, the missing days are added automatically...
I do not have any NaN in my time series as you can see on the screen shot. But matlab is still adding non existing days in the graph so that I have about 30 days a month I guess...
Any idea how I can remove these very annoying gaps? Thank you very much in advance.
if true
title('Long-term model','FontSize',24);
ylabel('Indice and Risk premium evolution','FontSize',18);
leg=legend('Index','Rolling 89D','Rolling 144D','Momentum','location','northwest');
set(leg,'FontSize',20);
datetick('x','dd-mmm-yy','keeplimits')
grid on;
end

답변 (1개)

dpb
dpb 2018년 3월 12일
This ? appears closely related to <Plot-financial-data-continuously-in-time>. There's one solution given by Peter and I made a suggestion of how one might approach it more generically there. Unfortunately, if the nonstatic version doesn't serve your needs either I've yet to (and am unlikely to in the near future) have time to do anything along those lines.
This has come up a number of times; it appears common-enough for financial data that folks with the need should start submitting enhancement requests -- one presumes such would likely find their way into Financial TB first but it does seem like a general facility would be useful for any weekday time series that is reasonably prevalent throughout business world.

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by