Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Copying zoom parameters across different figures

26 views
Skip to first unread message

Matt J

unread,
Feb 5, 2010, 11:58:02 AM2/5/10
to
I have two image figures.

figure(1); imagesc(...)
figure(2); imagesc(...)

I use the zoom tool to magnify a portion of one of figure(1). I would then like to apply the same zoom parameters to figure(2). Is there an easy way to programmatically extract the zoom parameters of one and copy them to the second?

Bruno Luong

unread,
Feb 5, 2010, 12:46:02 PM2/5/10
to
"Matt J " <mattja...@THISieee.spam> wrote in message <hkhimq$550$1...@fred.mathworks.com>...

Use LINKAXES

Bruno

Matt J

unread,
Feb 5, 2010, 1:30:22 PM2/5/10
to
"Bruno Luong" <b.l...@fogale.findmycountry> wrote in message <hkhlgq$g7$1...@fred.mathworks.com>...

> Use LINKAXES
===============

Thanks. That actually put me on the trail of linkprops, which is even better for what I need.

Matt J

unread,
Feb 5, 2010, 4:39:20 PM2/5/10
to
A follow-up question. I would like to synchronize all figure properties, including, for example, the data tip. I.e., if I turn the data tip on in one figure, I'd like it to be turned on in the other automatically. I tried using linkprop(), but it doesn't seem to accept the WindowButton* properties as linkable. Is there a way to do this?

C Vasco

unread,
Nov 15, 2012, 2:54:21 PM11/15/12
to
"Matt J" wrote in message <hkhimq$550$1...@fred.mathworks.com>...
It has been a while since this was posted, but I found a solution that will work for a one-time "copy" of zoom parameters from one figure to another.

First, have the figure with desired zoom parameters selected or in focus.
Then, use
>> myaxes = axis
to get the current axis scaling and appearance.

Finally, select the target axis that will be updated and use
>> axis(gca, myaxes)
to apply the saved axis limits.

- C

Matt J

unread,
Nov 20, 2012, 2:16:08 PM11/20/12
to
"C Vasco" wrote in message <k83h9c$o63$1...@newscl01ah.mathworks.com>...
>
> First, have the figure with desired zoom parameters selected or in focus.
> Then, use
> >> myaxes = axis
> to get the current axis scaling and appearance.
>
> Finally, select the target axis that will be updated and use
> >> axis(gca, myaxes)
> to apply the saved axis limits.
===============

Good!
0 new messages