Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

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

1 vue (au cours des 30 derniers jours)
steven7337
steven7337 le 22 Oct 2015
Clôturé : MATLAB Answer Bot le 20 Août 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 :)

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by