How do I reset axis ticks to normal after I modify them?
34 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Suppose I have turned on datetick for a specific axis. Is there a way to turn off / reset the axis ticks to normal mode with 'set' commands?
0 comentarios
Respuesta aceptada
Patrick Kalita
el 31 de Mayo de 2011
You want to tell the axes to place the ticks wherever it thinks is best via the XTickMode property. You also want to tell the axes to decide automatically how to label those ticks using the XTickLabelMode property.
Here's the statement to do it:
set(gca, 'XTickMode', 'auto', 'XTickLabelMode', 'auto')
You can replace the call to gca with the axes handle if you have it. Of course you can set the YTickMode, ZTickMode, ect. properties if you applied datetick to the y- or z-axis.
Más respuestas (2)
Ivan van der Kroon
el 31 de Mayo de 2011
You can use
set(gca,'XTickLabel',xdate)
where xdate is your x-axis data. With datetick you're just changing the labels, but not the ticks themselves. Hope it helps!
1 comentario
Martijn Steenwijk
el 31 de Mayo de 2011
1 comentario
Oleg Komarov
el 31 de Mayo de 2011
Solutions don't work says nothing about your problem (since both solutions do work if applied coherently) and it's not clear what's your problem.
To see what's the difference with your problem post the formatted code (editing your answer), otherwise no clue.
Ver también
Categorías
Más información sobre Grid Lines, Tick Values, and Labels en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!