How to hide representative duration at datetime X-axis plot?
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Euigyeong Hong
am 8 Okt. 2020
Kommentiert: Euigyeong Hong
am 21 Sep. 2023
How to remove/hide representative duration at datetime X-axis plot under auto-mode condition(XTickLabelMode)?
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 8 Okt. 2020
Bearbeitet: Ameer Hamza
am 8 Okt. 2020
You can do it by running the following statements.
ax = gca;
ax.XTickLabel = ax.XTickLabel;
or
ax = gca;
ax.XTickLabelMode = 'manual';
4 Kommentare
Ameer Hamza
am 8 Okt. 2020
I think for normal visualization, when you need to zoom on the axes, the date might not be an issue. Just turn it off when printing or saving the image.
Weitere Antworten (2)
Adam Danz
am 20 Sep. 2023
Starting in MATLAB R2023b, you can add, remove, or update the secondary labels using
Demo
plot(datetime(2014,6,9)+days(0:9), 0:9)
xsecondarylabel(Visible="off")
Seth Furman
am 12 Okt. 2020
Bearbeitet: Seth Furman
am 12 Okt. 2020
If you just want the duration data for the time of day on the x-axis, you can use the timeofday method for datetime.
>> x = datetime('today'):hours(1):datetime('today')+hours(10);
>> y = 0:10;
>> plot(timeofday(x),y)
>> xtickformat('hh:mm')
1 Kommentar
Siehe auch
Kategorien
Mehr zu Visual Exploration 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!