Reputation: 2502
When I use the following code to display an image, it displays fine, but the figure window is cropped close around the figure so that the title is cut off. It's definitely there though because if I manually make the window taller, then the title becomes visible.
I think this is my fault because a while back I was messing around with default settings for how MATLAB fits the window to the axis. Now I just can't remember the settings that changed this. Can anyone help? Thanks.
Code:
figure();
imshow(my_img);
title('A Sample Image');
Upvotes: 8
Views: 16086
Reputation: 1
I changed the axis.position to smaller [0,0,0.7,0.7] and be able to see the title
Upvotes: 0
Reputation: 1
Similar to the solution by Blairg23; adding spaces to the end of the title works.
Upvotes: 0
Reputation: 5294
I found a solution for my case (3D plot). The problem was the command axis vis3d
. So please, do NOT use this:
axis vis3d
Upvotes: 0
Reputation: 12045
I fixed this problem in a work around by adding an ellipses to the end of my titles. 3 or 4 dots at the end of your title and the dots will get cut off, but the words remain! It should be noted that this has never happened to me in the past (and only on my Macbook Pro OSX machine), so it might be an install or compatibility issue.
Upvotes: 0
Reputation: 267
From Matlab (2008) help (search for Automatic Axes Resize):
"When you add axis labels and a title, the TightInset changes to accommodate the additional text [...] Using OuterPosition as the ActivePositionProperty: As you resize the figure, MATLAB maintains the area defined by the TightInset + Position so the text is not cut off. "
i.e.
set(gca, 'ActivePositionProperty', 'OuterPosition');
fixed it
Upvotes: 0
Reputation: 2502
OK, I found it. In R2010a, it can be fixed by going "File -> Preferences -> Image Processing" and under IMSHOW Display, setting Border Style to Loose. Don't know why I didn't notice this before. Thanks everyone.
Upvotes: 9
Reputation: 608
Try that: in Figure window, search for options/preferences in menu and then try to recover original options
Later, I'll improve my answer (I don't have Matlab here...).
Upvotes: 0