Why do my labels disappear when I open my FIG-file and zoom in on the axes or change the axes limits?

8 views (last 30 days)
Why do my labels disappear when I open my FIG-file and zoom in on the axes or change the axes limits?
I created a FIG-file with the following commands:
plot(1:10)
xlabel('X axis'), ylabel('Y axis'), title('My Line')
saveas(gcf, 'myline.fig')
When I open the FIG-file in MATLAB using the OPEN command, I can zoom in on the axes, but then my labels disappear:
open myline.fig
zoom on
disp('Click on the axes')
I want to be able to zoom in on the axes and still be able to see the labels in my plot, as I can with the original figure in MATLAB.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This enhancement has been incorporated in Release 14 Service Pack 2 (R14SP2). For previous product releases, please read below for any possible workarounds:
This enhancement has been made for Release 14 (R14). For previous product releases, please read below for any possible workarounds:
This is a bug in MATLAB that has been brought to the attention of our development staff for further investigation.
You can work around the problem by setting the Units of the labels in your figure to 'normal' after you load in your FIG-file. For example:
open myline.fig
%get the handles to each text object:
xhandle = get(gca, 'Xlabel');
yhandle = get(gca, 'Ylabel');
thandle = get(gca, 'Title');
set([xhandle; yhandle; thandle], 'units', 'normal');

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!