How to hide representative duration at datetime X-axis plot?
Mostrar comentarios más antiguos
How to remove/hide representative duration at datetime X-axis plot under auto-mode condition(XTickLabelMode)?


Respuesta aceptada
Más respuestas (2)
Ameer Hamza
el 8 de Oct. de 2020
Editada: Ameer Hamza
el 8 de Oct. de 2020
You can do it by running the following statements.
ax = gca;
ax.XTickLabel = ax.XTickLabel;
or
ax = gca;
ax.XTickLabelMode = 'manual';
4 comentarios
Euigyeong Hong
el 8 de Oct. de 2020
Ameer Hamza
el 8 de Oct. de 2020
There does not seem to be a documented way.
Euigyeong Hong
el 8 de Oct. de 2020
Ameer Hamza
el 8 de Oct. de 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.
Seth Furman
el 12 de Oct. de 2020
Editada: Seth Furman
el 12 de Oct. de 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 comentario
Euigyeong Hong
el 12 de Oct. de 2020
Editada: Euigyeong Hong
el 12 de Oct. de 2020
Categorías
Más información sobre Graphics Object Properties en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

