remove certain yticklabels from axis
Mostrar comentarios más antiguos
I have a plot that has a yaxis range from 0 to 9.
I only want the yticklabels for 1 to 8 to be visible.
I have tried:
yticks = get(gca,'YTick');
ytickLabels = get(gca,'YTickLabel');
set(gca,'YTick',yticks(1:1:8), 'YTickLabel',ytickLabels(1:1:8));
But this doesnt work. How do I not show the 0 and the 9 on the ytick labels? Thanks
Respuesta aceptada
Más respuestas (1)
Ilham Hardy
el 6 de En. de 2015
Editada: Ilham Hardy
el 6 de En. de 2015
Perhaps,
set(gca,'YLim',[1,8]);
1 comentario
Jason
el 6 de En. de 2015
Categorías
Más información sobre Data Distribution Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!