I plot a horizontal boxplot in MATLAB -- boxplot(y, group,'orientation','horizontal')
, and then hide the y-axis using set(gca,'box','off','ycolor','w')
.
It looks fine on the screen - only the bottom x-axis is visible. But whenever I save the figure to file, using either the print()
function or matlabfrag.m
, the left y-axis reappears in the output file (although it doesn't show up in MATLAB's visualization of the figure).
How can I keep this y-axis hidden?
I know this is an old post, but the following also remove the tick marks which is probably what you want:
set(gca, 'YTick', []);
Try:
ax1 = gca; % gca = get current axis
ax1.YAxis.Visible = 'off'; % remove y-axis
ax1.XAxis.Visible = 'off'; % remove x-axis
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