Revision: 5877 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5877&view=rev Author: pkienzle Date: 2008年07月25日 21:32:06 +0000 (2008年7月25日) Log Message: ----------- update axis contains method for new transforms Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axis.py Modified: trunk/matplotlib/lib/matplotlib/axis.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axis.py 2008年07月25日 19:52:11 UTC (rev 5876) +++ trunk/matplotlib/lib/matplotlib/axis.py 2008年07月25日 21:32:06 UTC (rev 5877) @@ -1144,13 +1144,17 @@ """ if callable(self._contains): return self._contains(self,mouseevent) - xpixel,ypixel = mouseevent.x,mouseevent.y + x,y = mouseevent.x,mouseevent.y try: - xaxes,yaxes = self.axes.transAxes.inverse_xy_tup((xpixel,ypixel)) - xorigin,yorigin = self.axes.transAxes.xy_tup((0,0)) + trans = self.axes.transAxes.inverted() + xaxes,yaxes = trans.transform_point((x,y)) except ValueError: return False, {} - inaxis = xaxes>=0 and xaxes<=1 and ypixel<yorigin and ypixel>yorigin-self.pickradius + l,b = self.axes.transAxes.transform_point((0,0)) + r,t = self.axes.transAxes.transform_point((1,1)) + inaxis = xaxes>=0 and xaxes<=1 and ( + (y<b and y>b-self.pickradius) or + (y>t and y<t+self.pickradius)) return inaxis, {} def _get_tick(self, major): @@ -1376,13 +1380,17 @@ """ if callable(self._contains): return self._contains(self,mouseevent) - xpixel,ypixel = mouseevent.x,mouseevent.y + x,y = mouseevent.x,mouseevent.y try: - xaxes,yaxes = self.axes.transAxes.inverse_xy_tup((xpixel,ypixel)) - xorigin,yorigin = self.axes.transAxes.xy_tup((0,0)) + trans = self.axes.transAxes.inverted() + xaxes,yaxes = trans.transform_point((x,y)) except ValueError: return False, {} - inaxis = yaxes>=0 and yaxes<=1 and xpixel<xorigin and xpixel>xorigin-self.pickradius + l,b = self.axes.transAxes.transform_point((0,0)) + r,t = self.axes.transAxes.transform_point((1,1)) + inaxis = yaxes>=0 and yaxes<=1 and ( + (x<l and x>l-self.pickradius) or + (x>r and x<r+self.pickradius)) return inaxis, {} def _get_tick(self, major): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 5905 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5905&view=rev Author: ryanmay Date: 2008年07月27日 20:36:10 +0000 (2008年7月27日) Log Message: ----------- Fix a doc typo. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axis.py Modified: trunk/matplotlib/lib/matplotlib/axis.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axis.py 2008年07月27日 20:33:45 UTC (rev 5904) +++ trunk/matplotlib/lib/matplotlib/axis.py 2008年07月27日 20:36:10 UTC (rev 5905) @@ -218,7 +218,7 @@ #if isinstance(a, mlines.Line2D): a.set_clip_box(self.axes.bbox) def get_view_interval(self): - 'return the view Interval instance for the axis tjis tick is ticking' + 'return the view Interval instance for the axis this tick is ticking' raise NotImplementedError('Derived must override') def set_view_interval(self, vmin, vmax, ignore=False): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 7122 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7122&view=rev Author: astraw Date: 2009年05月19日 21:29:19 +0000 (2009年5月19日) Log Message: ----------- convert Axis.grid() docstrings to use complete sentences Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axis.py Modified: trunk/matplotlib/lib/matplotlib/axis.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axis.py 2009年05月18日 20:50:20 UTC (rev 7121) +++ trunk/matplotlib/lib/matplotlib/axis.py 2009年05月19日 21:29:19 UTC (rev 7122) @@ -934,12 +934,12 @@ def grid(self, b=None, which='major', **kwargs): """ - Set the axis grid on or off; b is a boolean use *which* = - 'major' | 'minor' to set the grid for major or minor ticks + Set the axis grid on or off; b is a boolean. Use *which* = + 'major' | 'minor' to set the grid for major or minor ticks. - if *b* is *None* and len(kwargs)==0, toggle the grid state. If + If *b* is *None* and len(kwargs)==0, toggle the grid state. If *kwargs* are supplied, it is assumed you want the grid on and *b* - will be set to True + will be set to True. *kwargs* are used to set the line properties of the grids, eg, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8324 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8324&view=rev Author: jdh2358 Date: 2010年05月19日 17:23:29 +0000 (2010年5月19日) Log Message: ----------- added get_children offsetTex patch; closes sf 3001208 Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axis.py Modified: trunk/matplotlib/lib/matplotlib/axis.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axis.py 2010年05月19日 00:32:37 UTC (rev 8323) +++ trunk/matplotlib/lib/matplotlib/axis.py 2010年05月19日 17:23:29 UTC (rev 8324) @@ -594,7 +594,7 @@ return self._scale.limit_range_for_scale(vmin, vmax, self.get_minpos()) def get_children(self): - children = [self.label] + children = [self.label, self.offsetText] majorticks = self.get_major_ticks() minorticks = self.get_minor_ticks() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8351 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8351&view=rev Author: efiring Date: 2010年05月31日 18:45:39 +0000 (2010年5月31日) Log Message: ----------- bugfix: set_ticklabels must operate on label2 as well as label1; closes 2957923 Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axis.py Modified: trunk/matplotlib/lib/matplotlib/axis.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axis.py 2010年05月31日 18:44:13 UTC (rev 8350) +++ trunk/matplotlib/lib/matplotlib/axis.py 2010年05月31日 18:45:39 UTC (rev 8351) @@ -1187,7 +1187,17 @@ """ Set the text values of the tick labels. Return a list of Text instances. Use *kwarg* *minor=True* to select minor ticks. + All other kwargs are used to update the text object properties. + As for get_ticklabels, label1 (left or bottom) is + affected for a given tick only if its label1On attribute + is True, and similarly for label2. The list of returned + label text objects consists of all such label1 objects followed + by all such label2 objects. + The input *ticklabels* is assumed to match the set of + tick locations, regardless of the state of label1On and + label2On. + ACCEPTS: sequence of strings """ #ticklabels = [str(l) for l in ticklabels] @@ -1201,13 +1211,19 @@ self.set_major_formatter( mticker.FixedFormatter(ticklabels) ) - ret = [] + ret1 = [] + ret2 = [] for i, tick in enumerate(ticks): if i<len(ticklabels): - tick.label1.set_text(ticklabels[i]) - ret.append(tick.label1) - tick.label1.update(kwargs) - return ret + if tick.label1On: + tick.label1.set_text(ticklabels[i]) + tick.label1.update(kwargs) + ret1.append(tick.label1) + if tick.label2On: + tick.label2.set_text(ticklabels[i]) + ret2.append(tick.label2) + tick.label2.update(kwargs) + return ret1 + ret2 def set_ticks(self, ticks, minor=False): """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8427 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8427&view=rev Author: efiring Date: 2010年06月13日 22:53:25 +0000 (2010年6月13日) Log Message: ----------- [2922387] axis.py: docstring fix by Ori Avtalion Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axis.py Modified: trunk/matplotlib/lib/matplotlib/axis.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axis.py 2010年06月13日 22:44:02 UTC (rev 8426) +++ trunk/matplotlib/lib/matplotlib/axis.py 2010年06月13日 22:53:25 UTC (rev 8427) @@ -666,7 +666,7 @@ raise NotImplementedError('Derived must override') def set_data_interval(self): - 'Set the axis data limits' + 'set the axis data limits' raise NotImplementedError('Derived must override') def set_default_intervals(self): @@ -1510,7 +1510,7 @@ return self.axes.dataLim.intervalx def set_data_interval(self, vmin, vmax, ignore=False): - 'return the Interval instance for this axis data limits' + 'set the axis data limits' if ignore: self.axes.dataLim.intervalx = vmin, vmax else: @@ -1776,7 +1776,7 @@ return self.axes.dataLim.intervaly def set_data_interval(self, vmin, vmax, ignore=False): - 'return the Interval instance for this axis data limits' + 'set the axis data limits' if ignore: self.axes.dataLim.intervaly = vmin, vmax else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8538 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8538&view=rev Author: ryanmay Date: 2010年07月09日 18:28:47 +0000 (2010年7月09日) Log Message: ----------- Fix setting of minor ticklabels. As far as I can tell, the extra call to set_major_formatter is due to an SVN merge error from the transforms branch. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axis.py Modified: trunk/matplotlib/lib/matplotlib/axis.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axis.py 2010年07月09日 18:21:30 UTC (rev 8537) +++ trunk/matplotlib/lib/matplotlib/axis.py 2010年07月09日 18:28:47 UTC (rev 8538) @@ -1423,11 +1423,9 @@ self.set_minor_formatter(mticker.FixedFormatter(ticklabels)) ticks = self.get_minor_ticks() else: - self.set_major_formatter( mticker.FixedFormatter(ticklabels) ) + self.set_major_formatter(mticker.FixedFormatter(ticklabels)) ticks = self.get_major_ticks() - self.set_major_formatter( mticker.FixedFormatter(ticklabels) ) - ret1 = [] ret2 = [] for i, tick in enumerate(ticks): @@ -1985,5 +1983,3 @@ self.axes.dataLim.intervaly = ymin, ymax if not viewMutated: self.axes.viewLim.intervaly = ymin, ymax - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.