it's me
it's me

Reputation: 188

Showing image title with imshow method in MATLAB

How can I show image titles in MATLAB figures? I have the following code below:

I=imread('./../images/pap.png');
subplot(1,2,1);
imshow(I); % here I want to show labels

Upvotes: 11

Views: 50749

Answers (1)

rayryeng
rayryeng

Reputation: 104514

Use the title command. It works pretty much like plot. imshow spawns a new figure so you can apply commands that you would for any figure in here. By using title, you will give your image a title and it appears at the top of your image.

As such:

I=imread('./../images/pap.png');
subplot(1,2,1);
imshow(I);
title('Labels'); % Place title here

Upvotes: 21

Related Questions