Can I have the improfile intensity graph added to subplot

2 ビュー (過去 30 日間)
Stephen Devlin
Stephen Devlin 2018 年 5 月 16 日
回答済み: Ameer Hamza 2018 年 5 月 16 日
Hi, I have an image I use improfile to give a plot of the intensity across an image using mouse clicks, is there a way to add that improfile generated plot to a subplot?
tiff_image = imread('liney.png');
hIm_orig2 = tiff_image(:,:,1:3);
hFig=figure('units','normalized','outerposition',[0 0 1 1]);
set(0,'CurrentFigure',hFig)
subplot(4,7,[1 2 3 4 8 9 10 11 15 16 17 18])
imshow(hIm_orig2)
title('reference image','FontSize',15,'Color',[0,0,.9])
improfile
Best regards, Steve

回答 (1 件)

Ameer Hamza
Ameer Hamza 2018 年 5 月 16 日
A simple way is to copy the axes object to the required figure.
hIm_orig2 = tiff_image(:,:,1:3);
hFig=figure('units','normalized','outerposition',[0 0 1 1]);
set(0,'CurrentFigure',hFig)
subplot(4,7,[1 2 3 4 8 9 10 11 15 16 17 18])
imshow(hIm_orig2)
title('reference image','FontSize',15,'Color',[0,0,.9])
improfile
axProfile = gca;
axProfileNew = copyobj(axProfile, hFig);
This will create an axis which will be overlapping the original axis. To remove overlapping and specify a position use axProfileNew.Position property.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by