How to rotate ylabel but still auto-resize plot axes?
24 views (last 30 days)
Show older comments
Joe Lister-Symonds on 8 Sep 2021
I would like to orientate my ylabel horizontally as shown in the image, however the axes dont auto-resize when I do this causing the ylabel to overlap the ticklabels. How can I set the axes to auto-resize, and if I cant whats the best alternative?
I have been setting my figure size using the following code:
And the ylabel orientation using:
Many thanks, Joe
Matt J on 8 Sep 2021
More Answers (1)
Adam Danz on 17 Mar 2023
Starting in MATLAB R2023a when you change the Rotation property of axis labels in a 2-D plot, the HorizontalAlignment and VerticalAlignment properties of the label automatically change to prevent overlap between the label and the axes.
ylabel('Really long axis label','FontSize',15,'rotation',0)
Find more on Visual Exploration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!