Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Copying zoom parameters across different figures

Subject: Copying zoom parameters across different figures

From: Matt J

Date: 5 Feb, 2010 16:58:02

Message: 1 of 6

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?

Subject: Copying zoom parameters across different figures

From: Bruno Luong

Date: 5 Feb, 2010 17:46:02

Message: 2 of 6

"Matt J " <mattjacREMOVE@THISieee.spam> wrote in message <hkhimq$550$1@fred.mathworks.com>...
> 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?

Use LINKAXES

Bruno

Subject: Copying zoom parameters across different figures

From: Matt J

Date: 5 Feb, 2010 18:30:22

Message: 3 of 6

"Bruno Luong" <b.luong@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.

Subject: Copying zoom parameters across different figures

From: Matt J

Date: 5 Feb, 2010 21:39:20

Message: 4 of 6

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?

Subject: Copying zoom parameters across different figures

From: C Vasco

Date: 15 Nov, 2012 19:54:21

Message: 5 of 6

"Matt J" wrote in message <hkhimq$550$1@fred.mathworks.com>...
> 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?

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

Subject: Copying zoom parameters across different figures

From: Matt J

Date: 20 Nov, 2012 19:16:08

Message: 6 of 6

"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!

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us