If we have a figure
plot(x, y);
grid on;
We get something like this
But now, I wish to hide the axis, so I tried the commands below:
axis off
set(gca,'xtick',[])
set(gca,'ytick',[])
set(gca,'visible','off')
Together they successfully hid the axis, but the grid was also deleted!
set(gca, 'xticklabel', [])
can hide the label, but not the axis.
So, how do I hide the axis, ticks and labels, leaving only the plot and grid?