Setting the xlim for datetime data
235 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sophia
am 3 Jan. 2022
Kommentiert: Star Strider
am 4 Jan. 2022
I would like to set the xlim of this graph from Nov 29 to Dec 24 in intervals of 2 or 3 days
See attached for data and script and current graph format
0 Kommentare
Akzeptierte Antwort
Star Strider
am 3 Jan. 2022
Perhaps something like this —
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/851315/collated_11.csv')
figure
plot(T1.Datetime, T1.Light)
grid
xlabel('Days')
ylabel('Light')
dl = datetime('29-Nov-2021');
dr = datetime('24-Dec-2021');
interval = days(2);
xtix = dl : interval : dr;
set(gca, 'XTick',xtix)
xlim([dl dr])
.
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Directed Graphs finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!