I have three axes in figure and I want to remove xtick
and ytick
from all of them.
I wrote below code but it works just on current axes, not all of them:
set(gca,'xtick',[],'ytick',[]);
How to remove xticks
and yticks
from all axes?
As a more general solution inspired by @Luis Mendo's answer, use findobj
to get the axes. This will avoid getting all children of the parent figure which could include "non-axes" elements:
set( findobj( gcf, 'Type', 'axes' ), 'XTick', [], 'YTick', [] );
This should work:
set(get(gcf,'Children'),'Xtick',[],'Ytick',[]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With