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

34 次查看(过去 30 天)
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 ;

采纳的回答

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

更多回答(1 个)

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

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by