How to remove weekend from a TimeTable Plot
Mostra commenti meno recenti
Hi!
I want to plot CandleStick pattern based on a TimeTable I have. In this case, I want to remove the gap on my chart caused by weekends. The following code simply remove the weekends from the timetable
T = T(~isweekend(T.DateTime),:);
However, I still have the gap when I plot the Candls since the xaxis shows the weekends gap! How can I remove this gap?

3 Commenti
dpb
il 20 Apr 2019
Unffortunately, the ML time axes simply aren't set up to do this...they plot absolute times and the weekends are real time intervals.
You would have to subtract off the missing days from the data after the weekend to make it appear to be the subsequent day--iow, Monday becomes Saturday, etc., ... of course, if you then want the correct actual dates on the ticks, you'll have to manually label them.
There really isn'at any clean way as of yet I'm aware of to deal with it--been couple of threads with similar issues recently with no easy answers.
dpb
il 21 Apr 2019
[moved A to Comment--dpb]
Hi!
I tried to plot the candle from a table (not timetable) and then lable the xaxis on date?
xticklabels(T.DateTime)
No success :(
Can we something with dateaxis?
dpb
il 21 Apr 2019
But T.Datetime would still be the actual times...did you try something like I suggested to actually make Monday appear to be Saturday, etc., ?
Or, plot only the data corresponding to your T vector as ordinal against position in resulting vector and then label the ticks to be the desired datetime strings--but then it will have to be the strings, not as dates.
Or, add a second datetime axis that has the T vector to display the time axis but plot the data on the ordinal x axis below...
As noted earlier, afaik, there is no easy builtin routine to handle it...
Risposte (0)
Categorie
Scopri di più su 2-D and 3-D Plots in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!