Can I have the improfile intensity graph added to subplot
1 view (last 30 days)
Show older comments
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
0 Comments
Answers (1)
Ameer Hamza
on 16 May 2018
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.
0 Comments
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!