which must be part of the issue here, since the minima should be 0.5, not 0. If I use set_xlim and set_ylim instead of ax.xaxis.set_view_interval, it works fine, so there must be a bug in set_view_interval?
Note that this issue is not related to #117, and occurs even if the patch in #117 is applied.
The problem here is that Axis.set_view_interval should be an obscure
private method, or it should be broken up into two methods, perhaps one
or both of which should also be obscure and private; its only internal
use, as far as I can see, is in ticker.py. The methods that are
intended for public use in setting the viewLim are the Axes methods.
The original implementation of Axis.set_view_interval was broken for its
original purpose; I fixed that, but did not put enough additional
explanation in the docstring (which was previously missing entirely, and
maybe should have been left so) to fully explain what the ignore kwarg
does--which is to change the behavior so that it not only preserves the
original order (hence axis inversion, if any), but also permits only
expansion, not contraction, of the interval. It is this very different
sort of functionality, required by ticker, that is causing the confusion.
So: minimal solution is to improve the docstring; a cleaner long-term
solution would involve ending up with two methods instead of one, and no
kwarg. How to do this in with minimal user code breakage and with good,
readable names for all methods is not obvious to me yet.
Ok, I understand now that these methods are not meant to be public. I'm not sure why I originally used them instead of set_xlim and set_ylim, but I must have stumbled upon them and assumed they were public. I'm just going to switch to set_xlim and set_ylim for my code.
Activity
astrofrog commented on May 21, 2011
In def set_view_interval in axis.py, should the following lines:
Vmin, Vmax = self.get_view_interval() if Vmin < Vmax: self.axes.viewLim.intervalx = (min(vmin, vmax, Vmin), max(vmin, vmax, Vmax)) else: self.axes.viewLim.intervalx = (max(vmin, vmax, Vmin), min(vmin, vmax, Vmax))Not be the following?
if Vmin < Vmax: self.axes.viewLim.intervalx = (min(vmin, vmax), max(vmin, vmax)) else: self.axes.viewLim.intervalx = (max(vmin, vmax), min(vmin, vmax))Basically, the old limits should be used to determine the order, but apart from that, why should they appear in the min(...) and max(...) expressions?
leejjoon commented on May 24, 2011
The changelog entry of the associated commit seems to indicate that this is an intended behavior.
cb5cab4
@efiring, can you comment on this?
For example,
prints
which seems a bit inconsistent.
efiring commented on May 24, 2011
On 05/23/2011 06:57 PM, leejjoon wrote:
The problem here is that Axis.set_view_interval should be an obscure
private method, or it should be broken up into two methods, perhaps one
or both of which should also be obscure and private; its only internal
use, as far as I can see, is in ticker.py. The methods that are
intended for public use in setting the viewLim are the Axes methods.
The original implementation of Axis.set_view_interval was broken for its
original purpose; I fixed that, but did not put enough additional
explanation in the docstring (which was previously missing entirely, and
maybe should have been left so) to fully explain what the ignore kwarg
does--which is to change the behavior so that it not only preserves the
original order (hence axis inversion, if any), but also permits only
expansion, not contraction, of the interval. It is this very different
sort of functionality, required by ticker, that is causing the confusion.
So: minimal solution is to improve the docstring; a cleaner long-term
solution would involve ending up with two methods instead of one, and no
kwarg. How to do this in with minimal user code breakage and with good,
readable names for all methods is not obvious to me yet.
Eric
astrofrog commented on May 24, 2011
Ok, I understand now that these methods are not meant to be public. I'm not sure why I originally used them instead of set_xlim and set_ylim, but I must have stumbled upon them and assumed they were public. I'm just going to switch to set_xlim and set_ylim for my code.
axis.py: clarify docstring for set_view_interval. Closes issue #118.