How can i set middle tick?

2 visualizaciones (últimos 30 días)
Gabriel Maia
Gabriel Maia el 17 de Ag. de 2018
Editada: Gabriel Maia el 17 de Ag. de 2018
I want to set a graph with middle tics without number, like the picture. Also i need to enable sides ticks. How can i do it?

Respuesta aceptada

Adam Danz
Adam Danz el 17 de Ag. de 2018
Editada: Adam Danz el 17 de Ag. de 2018
To turn on 'minor' ticks:
set(gca,'XMinorTick','on')
What's a side tick? Check out all the properties of ticks you can set:
  6 comentarios
Gabriel Maia
Gabriel Maia el 17 de Ag. de 2018
Editada: Gabriel Maia el 17 de Ag. de 2018
I got it now.
ax = gca;
ax.XAxis.MinorTick = 'on';
ax.XAxis.MinorTickValues = -7.5:1:7.5;
Adam Danz
Adam Danz el 17 de Ag. de 2018
I see the problem. You don't need to create another axis. You only need the axis handle of your current axis.
replace
hA = axes
with
hA = gca;
unless you already have your current axis handle available.
Also your minor ticks should be
-7.5 : 2 : 7.5

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Grid Lines, Tick Values, and Labels en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by