How to remove xticks and yticks from all axes?

I have three axes in the figure, and I want to remove xtick, and ytickfrom all of them. I wrote the code below, but it only works on the current axes, and not on all of them:

set(gca,'xtick',[],'ytick',[]);

How to remove xticksand yticksof all axes?

+4
source share
2 answers

As a more general solution based on @Luis Mendo's answer, use findobjto get the axes. This will avoid all children of the parent figure, which may include elements without axial elements:

set( findobj( gcf, 'Type', 'axes' ), 'XTick', [], 'YTick', [] );
+6
source

This should work:

set(get(gcf,'Children'),'Xtick',[],'Ytick',[]);
+2
source

Source: https://habr.com/ru/post/1679498/


All Articles