Wants to get multiple figures in same image for one frame

2 ビュー (過去 30 日間)
hiru shashikala
hiru shashikala 2021 年 11 月 5 日
編集済み: yanqi liu 2021 年 11 月 6 日
I plot image and get multiple figures gray scale, histogram like wise, I need to take this separate figures in same frame with labels.
  2 件のコメント
KSSV
KSSV 2021 年 11 月 5 日
Read about subplot, montage. If not show us your requirement clearly.
Sudharsana Iyengar
Sudharsana Iyengar 2021 年 11 月 5 日
hi,
It seems like you want to put in gray scale and histogram, I think you are working in image processing. One can use hold on if you are plotting only two images on each other and adjust the transparency.
you can try subplot if there are multiple images that needs to be displayed.
I found this on file exchange: This reduces the gap between two plots in matlab.
https://www.mathworks.com/matlabcentral/fileexchange/34594-subplotplus-enhanced-layout-matlab-subplot-function

サインインしてコメントする。

回答 (1 件)

yanqi liu
yanqi liu 2021 年 11 月 6 日
編集済み: yanqi liu 2021 年 11 月 6 日
clc; clear all; close all;
% I plot image and get multiple figures gray scale, histogram like wise,
% I need to take this separate figures in same frame with labels.
fs = {'football.jpg', 'rice.png', 'cameraman.tif'};
for i = 1 : numel(fs)
fi = fs{i};
imi = imread(fi);
imio = imi;
if ndims(imi) == 3
imi = rgb2gray(imi);
end
figure(i);
subplot(2,2,1); imshow(imio); title([fi ' origin']);
subplot(2,2,2); imshow(imi); title([fi ' gray']);
subplot(2,2,3); imhist(imi); title([fi ' hist']);
end

カテゴリ

Help Center および File ExchangeImages についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by