Search code examples
matlabmatlab-figure

MATLAB how to turn off the yaxis created by 'yyaxis' command?


How to turn off (totally) a yaxis in a Matlab figure?

Google only tell me how to create an extra yaxis.

Appreciate any help.


Solution

  • Use the axis handle to modify either y axis.

    hfig=figure;
    hax=axes;
    yyaxis(hax,'left')
    hax.YAxis(1).Visible='off'; % Removes left axis
    hax.YAxis(2).Visible='off'; % Removes right axis