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');
Create Title and SubtitleCreate a plot. Then create a title and a subtitle by calling the title function with two character vectors as arguments. Use the 'Color' name-value pair argument to customize the color for both lines of text. Specify two return arguments to store the text objects for the title and subtitle.
By default the FontSize property is 10 points and the TitleFontSizeMultiplier is 1.100 , which means that the title font size is 11 points. To change the title font size without affecting the rest of the font in the axes, set the TitleFontSizeMultiplier property of the axes.
reset(h) resets all properties on the object identified by h to their default values. Properties that do not have default values are not affected. If h is a figure, then MATLAB® software does not reset Position , Units , WindowStyle , or PaperUnits .
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With