<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169335</link>
    <title>MATLAB Central Newsreader - OVERVIEW PLOT ZOOM DRAG PAN</title>
    <description>Feed for thread: OVERVIEW PLOT ZOOM DRAG PAN</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 15 May 2008 17:53:02 -0400</pubDate>
      <title>OVERVIEW PLOT ZOOM DRAG PAN</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169335#432312</link>
      <author>Frank Pezzulo</author>
      <description>Dear All,&lt;br&gt;
&lt;br&gt;
I have a problem. I have a GUI where there are two axes, one&lt;br&gt;
large and one smaller. I would that when i plot something in&lt;br&gt;
large axes, in the small axes there are the same plots but&lt;br&gt;
more small. Other when i pan in large axes i would that in&lt;br&gt;
small axes there is a rectangular that see what part of&lt;br&gt;
large axes i'm panning .... so i would like google map where&lt;br&gt;
there are a large map and a little overview.&lt;br&gt;
&lt;br&gt;
I know that in Matlab File Exchange there is a function&lt;br&gt;
called "OVERVIEW PLOT" that it do it, but i don't know how&lt;br&gt;
modify it for my GUI system .... CAN YOU HELP ME?&lt;br&gt;
&lt;br&gt;
THANKS&lt;br&gt;
&lt;br&gt;
FRANCESCO&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Thu, 15 May 2008 18:16:01 -0400</pubDate>
      <title>Re: OVERVIEW PLOT ZOOM DRAG PAN</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169335#432324</link>
      <author>helper </author>
      <description>"Frank Pezzulo" &amp;lt;john.doe.nospam@mathworks.com&amp;gt; wrote in &lt;br&gt;
message &amp;lt;g0ht9u$83h$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Dear All,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I have a problem. I have a GUI where there are two axes, &lt;br&gt;
one&lt;br&gt;
&amp;gt; large and one smaller. I would that when i plot something &lt;br&gt;
in&lt;br&gt;
&amp;gt; large axes, in the small axes there are the same plots but&lt;br&gt;
&amp;gt; more small. &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
When you plot to the big axis, use the handle:&lt;br&gt;
&lt;br&gt;
plot(hBigAxis, xData, yData)&lt;br&gt;
&lt;br&gt;
And just repeat the same command for the small axis:&lt;br&gt;
&lt;br&gt;
plot(hLittleAxis, xData, yData)&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
In addition, do two more things.  Be sure to "hold" the &lt;br&gt;
little axis, and plot a line at some arbitrary point to be &lt;br&gt;
used as your rectangle later:&lt;br&gt;
&lt;br&gt;
hold(hLittleAxis,'on')&lt;br&gt;
hRectangle = plot(0,0);&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt; Other when i pan in large axes i would that in&lt;br&gt;
&amp;gt; small axes there is a rectangular that see what part of&lt;br&gt;
&amp;gt; large axes i'm panning .... so i would like google map &lt;br&gt;
where&lt;br&gt;
&amp;gt; there are a large map and a little overview.&lt;br&gt;
&lt;br&gt;
You can specify callbacks for panning and zooming &lt;br&gt;
operations.  For example, when you create the figure, use &lt;br&gt;
an output variable to get the figure's handle:&lt;br&gt;
&lt;br&gt;
hFig = figure;&lt;br&gt;
&lt;br&gt;
Then, use the following commands to set the panning and &lt;br&gt;
zooming callbacks:&lt;br&gt;
&lt;br&gt;
hZoom = zoom(hFig);&lt;br&gt;
hPan = pan(hFig);&lt;br&gt;
&lt;br&gt;
set(hZoom,'ActionPostCallback',@(x,y)PanZoom_Callback)&lt;br&gt;
set(hPan,'ActionPreCallback',...&lt;br&gt;
&amp;nbsp;&amp;nbsp;@(x,y)set(hFig,'WindowButtonMotionFcn',...&lt;br&gt;
&amp;nbsp;&amp;nbsp;@(x,y)PanZoom_Callback))&lt;br&gt;
set(hPan,'ActionPostCallback',...&lt;br&gt;
&amp;nbsp;&amp;nbsp;@(x,y)set(hFig,'WindowButtonMotionFcn',...&lt;br&gt;
&amp;nbsp;&amp;nbsp;[]))&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Now, you need to create a function &lt;br&gt;
called "PanZoom_Callback.m".  This callback will be called  &lt;br&gt;
once when you finish zooming or many times while you are &lt;br&gt;
panning.  Within this function, do something like:&lt;br&gt;
&lt;br&gt;
function PanZoom_Callback&lt;br&gt;
axLims = axis(hBigAxis);&lt;br&gt;
xRect = axLims(1) + axLims(3)*[0 1 1 0 0];&lt;br&gt;
yRect = axLims(2) + axLims(4)*[0 1 1 0 0];&lt;br&gt;
set(hRectangle,'xdata',xRect,...&lt;br&gt;
&amp;nbsp;&amp;nbsp;'ydata',yRect)&lt;br&gt;
drawnow&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
The biggest problem you will have that I have not explained &lt;br&gt;
is how to make all these handles (i.e., hBigAxis, hFig, &lt;br&gt;
hPan,...) available when you need them.&lt;br&gt;
&lt;br&gt;
For more information on this, search for "passing variables &lt;br&gt;
within GUIs" or "using nested functions in GUIs".  There &lt;br&gt;
are a lot of references in the MATLAB documentation and in &lt;br&gt;
this newsgroup on this topic.&lt;br&gt;
&lt;br&gt;
I hope this gets you started.&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
