Pramith Chathuranga
Pramith Chathuranga

Reputation: 524

How to show the image name as the title of the window in matlab

How to get the name of the image as the title of the window when using imshow in matlab.

Eg: I use the following code as to show the original image and the skeletonized image.

figure
subplot(1,2,1)
imshow(BW_Original)
subplot(1,2,2)
imshow(BW_Thinned)

I want to show the image name as the title of the window that pop ups. Can someone help me with this. Thank you.

Upvotes: 2

Views: 712

Answers (2)

Wolfie
Wolfie

Reputation: 30046

You can set the name of the figure when calling figure

figure('name', 'BW comparison image name here')
subplot(1,2,1); imshow(BW_Original);
subplot(1,2,2); imshow(BW_Thinned);

Gnovice also mentions that you might want to remove the figure number from the name, this can be done when calling figure too:

figure('name', 'BW comparison image name here', 'numbertitle', 'off')

Upvotes: 1

gnovice
gnovice

Reputation: 125864

You'll want to change the 'Name' property of the figure to your image name, as well as setting the 'NumberTitle' property to 'off' (to remove the "Figure #:" that appears):

set(gcf, 'Name', 'image_name', 'NumberTitle', 'off');

Upvotes: 3

Related Questions