<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Determining axes zoom state	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/determining-axes-zoom-state/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/determining-axes-zoom-state?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=determining-axes-zoom-state</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Mon, 04 Jul 2016 04:10:33 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.3</generator>
	<item>
		<title>
		By: tim		</title>
		<link>https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-382249</link>

		<dc:creator><![CDATA[tim]]></dc:creator>
		<pubDate>Mon, 04 Jul 2016 04:10:33 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2529#comment-382249</guid>

					<description><![CDATA[The suggested solution seems to fail when zoom is constrained to only one axis and/or zoom mode is changed. Not all lim fields exist in  &#039;matlab_graphics_resetplotview&#039; for constrained axis zoom (so testing the others will throw an error). It also seems that fields are not updated when zoom mode is changed (eg from horizontal to unconstrained). A change in mode can however be detected by comparing gca&#039;s limmode for each axis to those in matlab_graphics_resetplotview. But I don&#039;t think it is then possible to tell if the current zoom value (ie lim) is different to its original setting if that axis did not have its zoom mode on originally.
A minimalist solution would be to store the 3 axes&#039; limits on creation.

NB r2016a]]></description>
			<content:encoded><![CDATA[<p>The suggested solution seems to fail when zoom is constrained to only one axis and/or zoom mode is changed. Not all lim fields exist in  &#8216;matlab_graphics_resetplotview&#8217; for constrained axis zoom (so testing the others will throw an error). It also seems that fields are not updated when zoom mode is changed (eg from horizontal to unconstrained). A change in mode can however be detected by comparing gca&#8217;s limmode for each axis to those in matlab_graphics_resetplotview. But I don&#8217;t think it is then possible to tell if the current zoom value (ie lim) is different to its original setting if that axis did not have its zoom mode on originally.<br />
A minimalist solution would be to store the 3 axes&#8217; limits on creation.</p>
<p>NB r2016a</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Adee Ran		</title>
		<link>https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-378416</link>

		<dc:creator><![CDATA[Adee Ran]]></dc:creator>
		<pubDate>Sun, 29 May 2016 15:32:31 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2529#comment-378416</guid>

					<description><![CDATA[Thanks for exposing this (yet another) undocumented feature!

I used a variant to set the &quot;original zoom&quot; of only the horizontal axis - which &quot;zoom reset&quot; does not seem to support:
&lt;pre lang=&quot;matlab&quot;&gt;
rpv = getappdata(gca, &#039;matlab_graphics_resetplotview&#039;);
rpv.XLim = [tmin tmax]; % Use values calculated elsewhere
setappdata(gca, &#039;matlab_graphics_resetplotview&#039;, rpv);
&lt;/pre&gt;
Works like a charm.]]></description>
			<content:encoded><![CDATA[<p>Thanks for exposing this (yet another) undocumented feature!</p>
<p>I used a variant to set the &#8220;original zoom&#8221; of only the horizontal axis &#8211; which &#8220;zoom reset&#8221; does not seem to support:</p>
<pre lang="matlab">
rpv = getappdata(gca, 'matlab_graphics_resetplotview');
rpv.XLim = [tmin tmax]; % Use values calculated elsewhere
setappdata(gca, 'matlab_graphics_resetplotview', rpv);
</pre>
<p>Works like a charm.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Eduard Braun		</title>
		<link>https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-356899</link>

		<dc:creator><![CDATA[Eduard Braun]]></dc:creator>
		<pubDate>Sun, 13 Sep 2015 14:03:58 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2529#comment-356899</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-356868&quot;&gt;Eduard Braun&lt;/a&gt;.

Thanks for feedback!

I had looked at &lt;code&gt;zoom&lt;/code&gt; before but sadly it doesn&#039;t allow set specific numeric limits on the axes which makes it useless for many cases.

However it turned out the actual solution is pretty simple:
&lt;b&gt;1.&lt;/b&gt; Set the limits of the axes to the desired &quot;zoomed out&quot; state by setting appropriate limits.
&lt;b&gt;2.&lt;/b&gt; Use &lt;b&gt;&lt;code&gt;zoom(figure,&#039;reset&#039;)&lt;/code&gt;&lt;/b&gt; - this is were the &quot;magic&quot; happens and the current state of the figure is internally saved as the completely zoomed out state.
&lt;b&gt;3.&lt;/b&gt; Achieve the desired zooming by simply setting appropriate limits on the axes.

Steps 1 and 3 look redundant (and one would actually end up with the same visible content when just executing step 3.), however if one omits steps 1. and 2. it would not be possible to manually zoom out of the figure again!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-356868">Eduard Braun</a>.</p>
<p>Thanks for feedback!</p>
<p>I had looked at <code>zoom</code> before but sadly it doesn&#8217;t allow set specific numeric limits on the axes which makes it useless for many cases.</p>
<p>However it turned out the actual solution is pretty simple:<br />
<b>1.</b> Set the limits of the axes to the desired &#8220;zoomed out&#8221; state by setting appropriate limits.<br />
<b>2.</b> Use <b><code>zoom(figure,'reset')</code></b> &#8211; this is were the &#8220;magic&#8221; happens and the current state of the figure is internally saved as the completely zoomed out state.<br />
<b>3.</b> Achieve the desired zooming by simply setting appropriate limits on the axes.</p>
<p>Steps 1 and 3 look redundant (and one would actually end up with the same visible content when just executing step 3.), however if one omits steps 1. and 2. it would not be possible to manually zoom out of the figure again!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-356887</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sun, 13 Sep 2015 07:17:14 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2529#comment-356887</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-356868&quot;&gt;Eduard Braun&lt;/a&gt;.

@Eduard - you can use the &lt;i&gt;&lt;b&gt;zoom&lt;/b&gt;&lt;/i&gt; function with a certain factor, for example, &lt;code&gt;zoom(2.5)&lt;/code&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-356868">Eduard Braun</a>.</p>
<p>@Eduard &#8211; you can use the <i><b>zoom</b></i> function with a certain factor, for example, <code>zoom(2.5)</code></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Eduard Braun		</title>
		<link>https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-356868</link>

		<dc:creator><![CDATA[Eduard Braun]]></dc:creator>
		<pubDate>Sat, 12 Sep 2015 22:30:34 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2529#comment-356868</guid>

					<description><![CDATA[This is a very interesting way to determine if the axes are zoomed.

However I&#039;m wondering if it is possible to do this the other way round: Start with &lt;i&gt;unzoomed&lt;/i&gt; axes and programmatically bring them into a state as if they were zoomed in by the user?

For clarification: If I simply set &lt;code&gt;XLim&lt;/code&gt; and/or &lt;code&gt;YLim&lt;/code&gt; on the axes I can zoom in a portion of the graph but the user can not zoom out anymore... Therefore it&#039;s &lt;i&gt;not&lt;/i&gt; the same as if the user zoomed in (since then he obviously &lt;i&gt;can&lt;/i&gt; zoom out again).]]></description>
			<content:encoded><![CDATA[<p>This is a very interesting way to determine if the axes are zoomed.</p>
<p>However I&#8217;m wondering if it is possible to do this the other way round: Start with <i>unzoomed</i> axes and programmatically bring them into a state as if they were zoomed in by the user?</p>
<p>For clarification: If I simply set <code>XLim</code> and/or <code>YLim</code> on the axes I can zoom in a portion of the graph but the user can not zoom out anymore&#8230; Therefore it&#8217;s <i>not</i> the same as if the user zoomed in (since then he obviously <i>can</i> zoom out again).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-333767</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Fri, 10 Oct 2014 10:16:35 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2529#comment-333767</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-333765&quot;&gt;Adam&lt;/a&gt;.

@Adam - there are numerous small changes in 14b that are not officially documented. I guess this is yet another example.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-333765">Adam</a>.</p>
<p>@Adam &#8211; there are numerous small changes in 14b that are not officially documented. I guess this is yet another example.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Adam		</title>
		<link>https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-333765</link>

		<dc:creator><![CDATA[Adam]]></dc:creator>
		<pubDate>Fri, 10 Oct 2014 10:14:20 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2529#comment-333765</guid>

					<description><![CDATA[Hi Yair.  Do you know if something has changed in R2014b that would cause this to no longer work when the figure containing the axes is not yet visible when zoom reset is called?  It is one of a number of related things in my code that has broken from R2014a all seemingly related to whether or not a figure is actually visible yet or whether it is the figure in focus.  I fixed this case by just checking if the zoominfo object is empty (it is now in R2014b, it wasn&#039;t in R2014a when triggered from the OpeningFcn) and another case where creating a zoom object without an explicit figure used to match to the correct figure by default in R2013a, but picked up the figure that spawned it instead in R2014b was easy to fix.  

I couldn&#039;t see anything in the described graphics changes though that would explain this behaviour.  My troubles with findjobj also seem to relate to this type of issue, seemingly EDT effects that were not present in R2014a, but now break the code in R2014b.  In that case I just had to stop using the functionality, at least until I have more time to investigate.  The axis zoom state information in this blog has been very useful to me though so thank you for sharing.]]></description>
			<content:encoded><![CDATA[<p>Hi Yair.  Do you know if something has changed in R2014b that would cause this to no longer work when the figure containing the axes is not yet visible when zoom reset is called?  It is one of a number of related things in my code that has broken from R2014a all seemingly related to whether or not a figure is actually visible yet or whether it is the figure in focus.  I fixed this case by just checking if the zoominfo object is empty (it is now in R2014b, it wasn&#8217;t in R2014a when triggered from the OpeningFcn) and another case where creating a zoom object without an explicit figure used to match to the correct figure by default in R2013a, but picked up the figure that spawned it instead in R2014b was easy to fix.  </p>
<p>I couldn&#8217;t see anything in the described graphics changes though that would explain this behaviour.  My troubles with findjobj also seem to relate to this type of issue, seemingly EDT effects that were not present in R2014a, but now break the code in R2014b.  In that case I just had to stop using the functionality, at least until I have more time to investigate.  The axis zoom state information in this blog has been very useful to me though so thank you for sharing.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-324601</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Fri, 09 May 2014 13:47:14 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2529#comment-324601</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-324596&quot;&gt;Aleksander Hammernes&lt;/a&gt;.

&lt;pre lang=&#039;matlab&#039;&gt;
xlimits = get(hAxes,&#039;xlim&#039;);
ylimits = get(hAxes,&#039;ylim&#039;);
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-324596">Aleksander Hammernes</a>.</p>
<pre lang='matlab'>
xlimits = get(hAxes,'xlim');
ylimits = get(hAxes,'ylim');
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Aleksander Hammernes		</title>
		<link>https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-324596</link>

		<dc:creator><![CDATA[Aleksander Hammernes]]></dc:creator>
		<pubDate>Fri, 09 May 2014 11:46:27 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2529#comment-324596</guid>

					<description><![CDATA[Would it be possible to get the zoom area ? 
let say you activate the zoom function in a axes, normally this off course works fine, you can click and drag your mouse inside 
the axes, and it zoom`s the axes to your wishes. how ever not in my gui...... in need to replot to make it work for me, so is there a 
way to &quot;capture&quot; the x and y limits from the drag dragable zoom ?]]></description>
			<content:encoded><![CDATA[<p>Would it be possible to get the zoom area ?<br />
let say you activate the zoom function in a axes, normally this off course works fine, you can click and drag your mouse inside<br />
the axes, and it zoom`s the axes to your wishes. how ever not in my gui&#8230;&#8230; in need to replot to make it work for me, so is there a<br />
way to &#8220;capture&#8221; the x and y limits from the drag dragable zoom ?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-61696</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sat, 12 Nov 2011 15:34:02 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2529#comment-61696</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-61686&quot;&gt;Richard&lt;/a&gt;.

@Richard - take a look at the undocumented hidden axes property &lt;b&gt;LooseInset&lt;/b&gt;: http://undocumentedmatlab.com/blog/axes-looseinset-property/]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/determining-axes-zoom-state#comment-61686">Richard</a>.</p>
<p>@Richard &#8211; take a look at the undocumented hidden axes property <b>LooseInset</b>: <a href="http://undocumentedmatlab.com/blog/axes-looseinset-property/" rel="ugc">http://undocumentedmatlab.com/blog/axes-looseinset-property/</a></p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
