Borrar filtros
Borrar filtros

How do i make ticks invisible

31 visualizaciones (últimos 30 días)
Mahesh
Mahesh el 7 de Sept. de 2014
Comentada: Image Analyst el 8 de Sept. de 2014
I've made a figure with plot(x,y);
Now I'd like only the ticks attached to the ticks on the y-axis to be invisible but not the numbers. Does anyone have such ideas please!!

Respuesta aceptada

Star Strider
Star Strider el 7 de Sept. de 2014
You can’t turn the ticks on individual axes on or off, only all of them on or off. Ths solution is to turn all of them off and then add them selectively on the x-axis by plotting them with this:
plot( ... )
hold on
set(gca, 'TickLength',[0 0])
xt = get(gca, 'XTick');
yxt = diff(ylim)
plot([xt; xt], [ones(1,length(xt)); zeros(1,length(xt))]*yxt/100,'k')
hold off
I tested this and it works. If you have any trouble with it in your application, post your code and we’ll get it to work there as well.

Más respuestas (1)

Image Analyst
Image Analyst el 7 de Sept. de 2014
set(gca,'YTickLabel',[])
  2 comentarios
Mahesh
Mahesh el 7 de Sept. de 2014
Well, it makes invisible both tick and number. I mean just the tick. Thanks for response
Image Analyst
Image Analyst el 8 de Sept. de 2014
Why? What good are numbers without the tick mark? It's less precise.

Iniciar sesión para comentar.

Categorías

Más información sobre 2-D and 3-D Plots 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!

Translated by