Difficult resetting style sheet default for figure axis label

1 view (last 30 days)
How can I reset the style sheet default to make the figure left y-axis label (missing here, but appears in a full screen window in MATLAB) and values to appear in a minimized window and/or in print preview? I do not want to decrese the axes font size. I cannot attach the .fig file

Accepted Answer

Simon Chan
Simon Chan on 24 Feb 2023
Try to force the OuterPosition of the axis to 0, and at the same time the size of the plotting area may be smaller.
ax = gca; % Provided ax is the current axis handle
ax.OuterPosition(1)=0; % Force the starting OuterPosition to 0
  2 Comments
Doug Leaffer
Doug Leaffer on 24 Feb 2023
Thank you Simon. That is good workaround. When executed, the right color bar axes label (dB/Hz) now disappears from the minmized window. I can manually add a text box lable and move it slightly left to appear.
Simon Chan
Simon Chan on 24 Feb 2023
Sorry I overlooked your figure has colorbar on the right side.
In that case, you may retrieve the colorbar Position from its handle and force the width of the axis position to the beginning of the colorbar starting position as follows. Of course, the size of the plotting area will be further reduced.
ax = gca; % Provided ax is the current axis handle
ax.OuterPosition(1)=0; % Force the starting OuterPosition to 0
cb = colorbar(ax);
ax.OuterPosition(3)=cb.Position(1)+ cb.Position(3);

Sign in to comment.

More Answers (0)

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!