Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Copying zoom parameters across different figures
Replies: 5   Last Post: Nov 20, 2012 2:16 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Cristina Vasco

Posts: 6
Registered: 2/7/12
Re: Copying zoom parameters across different figures
Posted: Nov 15, 2012 2:54 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.