Return to previous zoom level/location
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Let's say I have created a figure using imagesc
imagesc(X(1,:),Y(:,1),I)
and I have then used the manual zoom tool to look at a particular region in the plot. I then do some changes to I (e.g. I2 = imdilate(I,ones(3))) and plot it again, say
imagesc(X(1,:),Y(:,1),I2)
and I want to zoom at the same extent again. What would be best practice to do so?
So far I tried to employ the Xlim and Ylim axis properties, such that
imagesc(X(1,:),Y(:,1),I); % zoom in somewhere manually
b = get(gca,'Xlim');
c = get(gca,'Ylim');
and then
imagesc(X(1,:),Y(:,1),I2)
set(gca,'Xlim',b,'Ylim',c)
but this won't allow me to zoom out afterwards.
0 commentaires
Réponse acceptée
Matt Fig
le 25 Mar 2011
Here is an example.
load clown
image(X)% Now zoom in on the eye.
% After zooming in, do this:
.
.
L = get(gca,{'xlim','ylim'}); % Get axes limits.
X = ind2rgb(X,map);
image(X)
zoom reset
set(gca,{'xlim','ylim'},L)
% Now the plot should be zoomed in around the eye again, but you can also zoom out.
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Exploration dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!