matlab ticks with certain labels

后端 未结 1 1707
栀梦
栀梦 2021-01-23 03:32

I have the following part:

set(gca,\'ylim\',[0 0.3],\'ytick\',0:0.05:0.3);
set(gca,\'xlim\',[0 1],\'xtick\',0:0.05:1);

Ticks must remain as the

1条回答
  •  离开以前
    2021-01-23 04:10

    You can assign labels to ticks using a cell array of strings, where each string corresponds to a tick. For ticks at which you don't want any label, use the empty string:

    set(gca,'xticklabel',{'0','','','','0.2','','','','0.4','','','','0.6','','','','0.8','','','','1'})
    set(gca,'yticklabel',{'0','','0.1','','0.2','','0.3'})
    

    0 讨论(0)
提交回复
热议问题