How to turn off X axis while keeping the X axis grid lines?

38 visualizaciones (últimos 30 días)
The x axis is turning off while using 'XTick', [ ] and gridlines are also removing(vertical lines). But I need to keep the grid lines and remove xaxis from the figure.
set(gca,'XTick',[],'fontweight' , 'bold','fontsize',12); xlim([0 122]); grid on ;

Respuesta aceptada

Sudharsana Iyengar
Sudharsana Iyengar el 5 de Nov. de 2021
Hi
Please try this and see if this is what you wanted.
grid on
set(gca,'Xticklabel',{})

Más respuestas (1)

Sudharsana Iyengar
Sudharsana Iyengar el 5 de Nov. de 2021
grid on
set(gca,'Xtick',[],'Ytick',[])
  1 comentario
Athul C P
Athul C P el 5 de Nov. de 2021
This is also not working. I added one figure I think by looking that you might be getting the actual problem.

Iniciar sesión para comentar.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by