Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 967
it's me Avatar asked Jul 19 '14 15:07

it's me


People also ask

How do I display image information in MATLAB?

To display image data, use the imshow function. The following example reads an image into the workspace and then displays the image in a figure window using the imshow function. You can also pass imshow the name of a file containing an image. imshow('moon.

How do you add a title to a figure in MATLAB?

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.

How use Imshow command in MATLAB?

imshow( I ,[]) displays the grayscale image I , scaling the display based on the range of pixel values in I . imshow uses [min(I(:)) max(I(:))] as the display range. imshow displays the minimum value in I as black and the maximum value as white. For more information, see the DisplayRange argument.


1 Answers

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
like image 167
rayryeng Avatar answered Nov 04 '22 02:11

rayryeng