Thread Subject: zoom bottom plot from plotyy

Subject: zoom bottom plot from plotyy

From: Jon Shultz

Date: 29 Aug, 2009 02:19:04

Message: 1 of 3

Since plotyy places the two axes directly on top of eachother, the zoom feature from the figure toolbar will only allow you to zoom the data plotted second. Is there a way to interactively zoom axis 1 without using the property inspector? I want to zoom the data independently, so linkaxes or linkprop aren't helpful. Also, I've tried to set the layer and HitTest and they haven't helped either.

Thanks

Subject: zoom bottom plot from plotyy

From: Paul Mennen

Date: 29 Aug, 2009 08:36:04

Message: 2 of 3

"Jon Shultz" wrote
> Since plotyy places the two axes directly on top of eachother, the zoom feature from the figure toolbar will only allow you to zoom the data plotted second. Is there a way to interactively zoom axis 1 without using the property inspector? I want to zoom the data independently, so linkaxes or linkprop aren't helpful.

I think you will find that "plt.m" (an alternative to plotyy, available from the FileEx) is much better at interactive zooming and panning, and more flexible regarding the axis linking question as well. To see what I mean, try the "demo\plt5.m" example which plots 5 traces (4 on the left axis and one on the right axis). Now click the mouse anywhere in the plot area (but not on a line) and hold the button down and drag. This pans the display. Note that the left and right axes are linked. Next click on the right hand y-axis label. (Note the appearance change). Then when you pan, note that the axes are now unlinked. There are ways to pan either axes independently even when they are linked. Zooming has similar flexibility. To get all the details on the topic, type "plt help" at the command window, go to the second section "Using the plt window" and then to the 3rd topic "panning and zooming"
and you will find all the panning and zooming methods clearly explained. If for some reason you don't find it so clear, just ask the author of plt.m ... which happens to be me :)

~Paul Mennen
paul (at) mennen (dot) org

Subject: zoom bottom plot from plotyy

From: Jon Shultz

Date: 3 Sep, 2009 18:41:08

Message: 3 of 3

"Paul Mennen" <nospam@mennen.org> wrote in message <h7ap9k$bp6$1@fred.mathworks.com>...
> "Jon Shultz" wrote
> > Since plotyy places the two axes directly on top of eachother, the zoom feature from the figure toolbar will only allow you to zoom the data plotted second. Is there a way to interactively zoom axis 1 without using the property inspector? I want to zoom the data independently, so linkaxes or linkprop aren't helpful.
>
> I think you will find that "plt.m" (an alternative to plotyy, available from the FileEx) is much better at interactive zooming and panning, and more flexible regarding the axis linking question as well. To see what I mean, try the "demo\plt5.m" example which plots 5 traces (4 on the left axis and one on the right axis). Now click the mouse anywhere in the plot area (but not on a line) and hold the button down and drag. This pans the display. Note that the left and right axes are linked. Next click on the right hand y-axis label. (Note the appearance change). Then when you pan, note that the axes are now unlinked. There are ways to pan either axes independently even when they are linked. Zooming has similar flexibility. To get all the details on the topic, type "plt help" at the command window, go to the second section "Using the plt window" and then to the 3rd topic "panning and
zooming"
> and you will find all the panning and zooming methods clearly explained. If for some reason you don't find it so clear, just ask the author of plt.m ... which happens to be me :)
>
> ~Paul Mennen
> paul (at) mennen (dot) org

Thanks, Paul. I found that I can change select the axis on top (yaxislocation = right) by:
a=findobj(gcf,'type',axes','yaxislocation','right');
...and then change the handlevisibility.
set(a,'handlevisibility,'off');
Then I can use the zoom button on the figure toolbar to zoom the left-yaxis plot.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
handlevisibility Jon Shultz 3 Sep, 2009 14:44:05
zoom button Jon Shultz 3 Sep, 2009 14:44:05
linkaxes Jon Shultz 28 Aug, 2009 22:19:09
zoom Jon Shultz 28 Aug, 2009 22:19:09
plotyy Jon Shultz 28 Aug, 2009 22:19:09
rssFeed for this Thread

Contact us at files@mathworks.com