Why am I unable to save the orientation of my Y-axis label?

1 view (last 30 days)
The default orientation of the Y-axis label generated using the YLABEL function is vertical, or with 90 degrees rotation. If this rotation is changed to 0 degrees, and the figure file is saved, then the y-axis label reverts to 90 degree rotation when the figure is opened.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
We have verified that there is a bug in MATLAB 7.0 (R14) and MATLAB 6.5.1 (R13sp1) in the way that MATLAB handles Y-axis label orientations. To work around this issue, you can use the text object's CreateFcn to set its Rotation to 90. In MATLAB 7.0, you can use an anonymous function for the CreateFcn callback:
ylabel('Y label','CreateFcn',@(h,e) set(h,'Rotation',45))
Here, 'h' refers to the handle for the text object.
In MATLAB 6.5, you can use a string to be evaluated for the CreateFcn, and use GCBO in the string to refer to the object's handle:
ylabel('Y label','CreateFcn','set(gcbo,''Rotation'',45)')

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!