Showing image title with imshow method in MATLAB

it's me picture it's me · Jul 19, 2014 · Viewed 29.1k times · Source

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

Answer

rayryeng picture rayryeng · Jul 19, 2014

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