Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Create a new figure from figure set of subplotting and keep the color limit

1 Ansicht (letzte 30 Tage)
steven7337
steven7337 am 22 Okt. 2015
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hi,
I built a script that can subplot several figures. And once you right click one of the figures, the program will show the figure you clicked alone on a new figure. The code is as follow:
figure;
for i = 1:6 % the amount of image, I set it to 6 for simplicity.
subplot(2,3,i);
h=imagesc(squeeze(im(:,:,i),'ButtonDownFcn', @newFigure1,[sdmin sdmax]);
% im is a image set. sdmin and sdmax stand for the min/max of clim
set(h,'UserData',i);
end
function newFigure1(h1,~)
switch get(gcf,'SelectionType')
case 'normal'
figure;
data = get(h1, 'CData');
imagesc(data); % I'd like to get the color limit of the original figure so that I can set the color range here
end
end
Now the problem I met is that for each figure in the subplotting, there's a unique sdmin/sdmax. And when I click the figure, the newly created figure will have a different sdmin/sdmax from the original version.
I wonder if there's anyway that I can get the clim of the original figure which is clicked in subplotting?
Thank you very much :)

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by