Setting window/picture title

Miko Kronn picture Miko Kronn · Oct 21, 2010 · Viewed 17.6k times · Source

I have:

img = imread('pic.jpg','jpg');
r = img(:,:,1);
g = img(:,:,2);
b = img(:,:,3);

figure, imshow(r);
figure, imshow(g);
figure, imshow(b);

How to set title over each picture?

Answer

Jonas picture Jonas · Oct 21, 2010

You want to change the Name-property of the figure window.

img = imread('pic.jpg','jpg');
r = img(:,:,1);
g = img(:,:,2);
b = img(:,:,3);

figure('Name','this is the red channel'), imshow(r);
figure('Name','this is the green channel','NumberTitle','off'), imshow(g);
title(gca,'you can also place a title like this')    

fh = figure; imshow(b);
set(fh,'Name','this is the blue channel')

Also, if you call imshow(g,[]), it will auto-scale the image to min/max.