how do I match the datetick?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Lilya
el 5 de Dic. de 2017
Comentada: Lilya
el 5 de Dic. de 2017
Hi all,
I've attached the plot that I want to correct the datetick (it doesn't match with the real date). Could anyone help, please?
thanks in advance.
2 comentarios
Walter Roberson
el 5 de Dic. de 2017
The x axes ranges from 0 to 800. What should the corresponding date and times be for 0 and 800, and which dates/times do you want marked on the axis?
Respuesta aceptada
Walter Roberson
el 5 de Dic. de 2017
h = openfig('AugWnd.fig');
ax = get(h,'CurrentAxes');
ax.XAxis.TickLabels = cellstr(datestr(ax.XAxis.TickValues/24 + datenum('2017-08-01'),'dd-mmm'));
Note that the ticks are 100 hours apart. You might want to consider changing ax.XAxis.TickValues to [0:96:799, 800] to get every 4 days plus the end point.
Más respuestas (0)
Ver también
Categorías
Más información sobre Grid Lines, Tick Values, and Labels en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!