SF.net SVN: matplotlib:[8293] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-05-04 05:24 Revision: 8293 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8293&view=rev Author: efiring Date: 2010-05-04 05:24:53 +0000 (Tue, 04 May 2010) Log Message: ----------- hist: accept a list of scalars as equivalent to a 1-D ndarray Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-05-03 18:37:38 UTC (rev 8292) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-05-04 05:24:53 UTC (rev 8293) @@ -6187,7 +6187,7 @@ precise point of intersection. Otherwise, the start and end points of the filled region will only occur on explicit values in the *x* array. - + *kwargs* keyword args passed on to the :class:PolyCollection @@ -6254,13 +6254,13 @@ return x[ind-1], y1[ind-1] elif np.ma.is_masked(diff_values[0]): return x[ind], y1[ind] - + diff_order = diff_values.argsort() diff_root_x = np.interp( 0, diff_values[diff_order], x_values[diff_order]) diff_root_y = np.interp(diff_root_x, x_values, y1_values) return diff_root_x, diff_root_y - + start = get_interp_point(ind0) end = get_interp_point(ind1) else: @@ -6272,12 +6272,12 @@ X[0] = start X[N+1] = end - + X[1:N+1,0] = xslice X[1:N+1,1] = y1slice X[N+2:,0] = xslice[::-1] X[N+2:,1] = y2slice[::-1] - + polys.append(X) collection = mcoll.PolyCollection(polys, **kwargs) @@ -7328,7 +7328,7 @@ 'hist now uses the rwidth to give relative width ' 'and not absolute width') - if isinstance(x, np.ndarray): + if isinstance(x, np.ndarray) or not iterable(x[0]): # TODO: support masked arrays; x = np.asarray(x) if x.ndim == 2: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

SF.net SVN: matplotlib:[5784] trunk/matplotlib/lib/matplotlib/axes.py <jdh2358@us...>
 SF.net SVN: matplotlib:[5813] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-07-22 19:47 Revision: 5813 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5813&view=rev Author: astraw Date: 2008-07-22 19:47:04 +0000 (Tue, 22 Jul 2008) Log Message: ----------- minor docstring fix Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-07-22 18:43:38 UTC (rev 5812) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-07-22 19:47:04 UTC (rev 5813) @@ -4724,7 +4724,7 @@ arguments will be used only if *c* is an array of floats. *cmap*: [ None | Colormap ] - A :class:matplotlib.cm.Colormap instance. If *None*, + A :class:matplotlib.colors.Colormap instance. If *None*, defaults to rc image.cmap. *cmap* is only used if *c* is an array of floats. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[5868] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-07-25 10:22 Revision: 5868 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5868&view=rev Author: dmkaplan Date: 2008-07-25 10:22:29 +0000 (Fri, 25 Jul 2008) Log Message: ----------- Committing a small change to make twinx share axes like twiny. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-07-25 06:30:52 UTC (rev 5867) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-07-25 10:22:29 UTC (rev 5868) @@ -6006,7 +6006,7 @@ right """ - ax2 = self.figure.add_axes(self.get_position(True), # sharex=self, + ax2 = self.figure.add_axes(self.get_position(True), sharex=self, frameon=False) ax2.yaxis.tick_right() ax2.yaxis.set_label_position('right') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[5898] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-07-27 01:17 Revision: 5898 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5898&view=rev Author: astraw Date: 2008-07-27 01:17:54 +0000 (Sun, 27 Jul 2008) Log Message: ----------- fix bug where reduce_C_function was being misapplied in hexbin() Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-07-27 00:58:51 UTC (rev 5897) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-07-27 01:17:54 UTC (rev 5898) @@ -5137,14 +5137,14 @@ for j in range(ny1): vals = lattice1[i,j] if len(vals): - lattice1[i,j] = reduce( reduce_C_function, vals ) + lattice1[i,j] = reduce_C_function( vals ) else: lattice1[i,j] = np.nan for i in range(nx2): for j in range(ny2): vals = lattice2[i,j] if len(vals): - lattice2[i,j] = reduce( reduce_C_function, vals ) + lattice2[i,j] = reduce_C_function( vals ) else: lattice2[i,j] = np.nan This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[5912] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-07-28 16:42 Revision: 5912 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5912&view=rev Author: jdh2358 Date: 2008-07-28 16:42:10 +0000 (Mon, 28 Jul 2008) Log Message: ----------- added some additional comments to axes to clarify the patch/frame relationship Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-07-28 16:37:00 UTC (rev 5911) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-07-28 16:42:10 UTC (rev 5912) @@ -1451,6 +1451,8 @@ self.apply_aspect(self.get_position(True)) + # the patch draws the background rectangle -- the frame below + # will draw the edges if self.axison and self._frameon: self.patch.draw(renderer) @@ -1506,6 +1508,9 @@ if self.legend_ is not None: artists.append(self.legend_) + # the frame draws the edges around the axes patch -- we + # decouple these so the patch can be in the background and the + # frame in the foreground. if self.axison and self._frameon: artists.append(self.frame) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[5916] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-07-29 10:53 Revision: 5916 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5916&view=rev Author: mmetz_bn Date: 2008-07-29 10:53:45 +0000 (Tue, 29 Jul 2008) Log Message: ----------- Minor hist-doc updates Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-07-28 19:59:19 UTC (rev 5915) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-07-29 10:53:45 UTC (rev 5916) @@ -6127,10 +6127,12 @@ is an integer input argument=numbins, *bins* + 1 bin edges will be returned, compatible with the semantics of :func:numpy.histogram with the *new* = True argument. + Unequally spaced bins are supported if *bins* is a sequence. *range*: The lower and upper range of the bins. Lower and upper outliers are ignored. If not provided, *range* is (x.min(), x.max()). + Range has no effect if *bins* is a sequence. *normed*: If *True*, the first element of the return tuple will @@ -6147,7 +6149,7 @@ gives the counts in that bin plus all bins for smaller values. The last bin gives the total number of datapoints. If *normed* is also *True* then the histogram is normalized such that the - last bin equals one. If *cumulative* evaluates to less that 1 + last bin equals one. If *cumulative* evaluates to less than 0 (e.g. -1), the direction of accumulation is reversed. In this case, if *normed* is also *True*, then the histogram is normalized such that the first bin equals 1. @@ -6167,8 +6169,7 @@ filled. *align*: ['left' | 'mid' | 'right' ] - Controls how the histogram is - plotted. + Controls how the histogram is plotted. - 'left': bars are centered on the left bin edges @@ -6178,7 +6179,8 @@ *orientation*: [ 'horizontal' | 'vertical' ] If 'horizontal', :func:~matplotlib.pyplot.barh will be - used and the *bottom* kwarg will be the left edges. + used for bar-type histograms and the *bottom* kwarg will be + the left edges. *rwidth*: the relative width of the bars as a fraction of the bin This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[5927] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-07-30 12:41 Revision: 5927 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5927&view=rev Author: mmetz_bn Date: 2008-07-30 12:41:04 +0000 (Wed, 30 Jul 2008) Log Message: ----------- use xrange instead of range in hexbin Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-07-29 21:42:37 UTC (rev 5926) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-07-30 12:41:04 UTC (rev 5927) @@ -5120,7 +5120,7 @@ lattice1.shape = (nx1,ny1) lattice2.shape = (nx2,ny2) - for i in range(len(x)): + for i in xrange(len(x)): if bdist[i]: lattice1[ix1[i], iy1[i]]+=1 else: @@ -5128,29 +5128,29 @@ else: # create accumulation arrays lattice1 = np.empty((nx1,ny1),dtype=object) - for i in range(nx1): - for j in range(ny1): + for i in xrange(nx1): + for j in xrange(ny1): lattice1[i,j] = [] lattice2 = np.empty((nx2,ny2),dtype=object) - for i in range(nx2): - for j in range(ny2): + for i in xrange(nx2): + for j in xrange(ny2): lattice2[i,j] = [] - for i in range(len(x)): + for i in xrange(len(x)): if bdist[i]: lattice1[ix1[i], iy1[i]].append( C[i] ) else: lattice2[ix2[i], iy2[i]].append( C[i] ) - for i in range(nx1): - for j in range(ny1): + for i in xrange(nx1): + for j in xrange(ny1): vals = lattice1[i,j] if len(vals): lattice1[i,j] = reduce_C_function( vals ) else: lattice1[i,j] = np.nan - for i in range(nx2): - for j in range(ny2): + for i in xrange(nx2): + for j in xrange(ny2): vals = lattice2[i,j] if len(vals): lattice2[i,j] = reduce_C_function( vals ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6063] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-09-04 18:29 Revision: 6063 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6063&view=rev Author: ryanmay Date: 2008-09-04 18:29:28 +0000 (Thu, 04 Sep 2008) Log Message: ----------- Correct return in docstring for boxplot. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-09-03 19:58:01 UTC (rev 6062) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-09-04 18:29:28 UTC (rev 6063) @@ -4504,8 +4504,9 @@ *x* is an array or a sequence of vectors. - Returns a list of the :class:matplotlib.lines.Line2D - instances added. + Returns a dictionary mapping each component of the boxplot + to a list of the :class:matplotlib.lines.Line2D + instances created. **Example:** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6095] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-09-15 12:58 Revision: 6095 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6095&view=rev Author: jrevans Date: 2008-09-15 19:58:25 +0000 (Mon, 15 Sep 2008) Log Message: ----------- Fixed bug #1889750. Now an axes will not attempt to determine the default units to use if units have already been determined for a particular Axis. Previously, by doing this it would override any axis labels set whenever any unit determination calls were made. This can still happen, but now some of the unneccessary unit determination calls are no longer being made. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-09-14 19:18:54 UTC (rev 6094) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-09-15 19:58:25 UTC (rev 6095) @@ -1374,11 +1374,15 @@ #print 'processing', self.get_geometry() if xdata is not None: - self.xaxis.update_units(xdata) + # we only need to update if there is nothing set yet. + if not self.xaxis.have_units(): + self.xaxis.update_units(xdata) #print '\tset from xdata', self.xaxis.units if ydata is not None: - self.yaxis.update_units(ydata) + # we only need to update if there is nothing set yet. + if not self.yaxis.have_units(): + self.yaxis.update_units(ydata) #print '\tset from ydata', self.yaxis.units # process kwargs 2nd since these will override default units This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6100] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-09-17 08:47 Revision: 6100 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6100&view=rev Author: jrevans Date: 2008-09-17 15:47:02 +0000 (Wed, 17 Sep 2008) Log Message: ----------- The previous fix broke the current behaviour of being able to explicitly set a new unit type for a specific axis after it was already set. This fixes that. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-09-17 02:10:58 UTC (rev 6099) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-09-17 15:47:02 UTC (rev 6100) @@ -1391,11 +1391,17 @@ if xunits!=self.xaxis.units: #print '\tkw setting xunits', xunits self.xaxis.set_units(xunits) + # If the units being set imply a different converter, we need to update. + if xdata is not None: + self.xaxis.update_units(xdata) yunits = kwargs.pop('yunits', self.yaxis.units) if yunits!=self.yaxis.units: #print '\tkw setting yunits', yunits self.yaxis.set_units(yunits) + # If the units being set imply a different converter, we need to update. + if ydata is not None: + self.yaxis.update_units(ydata) def in_axes(self, mouseevent): ''' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6140] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-10-01 08:04 Revision: 6140 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6140&view=rev Author: efiring Date: 2008-10-01 08:04:02 +0000 (Wed, 01 Oct 2008) Log Message: ----------- Fix bug in color handling by bar, found by Thomas Guettler Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-01 02:24:15 UTC (rev 6139) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-01 08:04:02 UTC (rev 6140) @@ -3822,25 +3822,22 @@ #width = np.asarray(width) #bottom = np.asarray(bottom) - if len(linewidth) == 1: linewidth = linewidth * nbars + if len(linewidth) < nbars: + linewidth *= nbars - # if color looks like a color string, an RGB tuple or a - # scalar, then repeat it by nbars - if (is_string_like(color) or - (iterable(color) and - len(color) in (3, 4) and - nbars != len(color)) or - not iterable(color)): - color = [color]*nbars + if color is None: + color = [None] * nbars + else: + color = list(mcolors.colorConverter.to_rgba_array(color)) + if len(color) < nbars: + color *= nbars - # if edgecolor looks like a color string, an RGB tuple or a - # scalar, then repeat it by nbars - if (is_string_like(edgecolor) or - (iterable(edgecolor) and - len(edgecolor) in (3, 4) and - nbars != len(edgecolor)) or - not iterable(edgecolor)): - edgecolor = [edgecolor]*nbars + if edgecolor is None: + edgecolor = [None] * nbars + else: + edgecolor = list(mcolors.colorConverter.to_rgba_array(edgecolor)) + if len(edgecolor) < nbars: + edgecolor *= nbars if yerr is not None: if not iterable(yerr): @@ -3850,13 +3847,12 @@ if not iterable(xerr): xerr = [xerr]*nbars + # FIXME: convert the following to proper input validation + # raising ValueError; don't use assert for this. assert len(left)==nbars, "argument 'left' must be %d or scalar" % nbars assert len(height)==nbars, "argument 'height' must be %d or scalar" % nbars assert len(width)==nbars, "argument 'width' must be %d or scalar" % nbars assert len(bottom)==nbars, "argument 'bottom' must be %d or scalar" % nbars - assert len(color)==nbars, "argument 'color' must be %d or scalar" % nbars - assert len(edgecolor)==nbars, "argument 'edgecolor' must be %d or scalar" % nbars - assert len(linewidth)==nbars, "argument 'linewidth' must be %d or scalar" % nbars if yerr is not None and len(yerr)!=nbars: raise ValueError("bar() argument 'yerr' must be len(%s) or scalar" % nbars) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6217] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-10-16 11:15 Revision: 6217 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6217&view=rev Author: mmetz_bn Date: 2008-10-16 11:15:25 +0000 (Thu, 16 Oct 2008) Log Message: ----------- minor optimizations: replacing range by xrange in for loops Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-15 20:53:09 UTC (rev 6216) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-16 11:15:25 UTC (rev 6217) @@ -243,7 +243,7 @@ x, y, multicol = self._xy_from_y(y) if multicol: - for j in range(y.shape[1]): + for j in xrange(y.shape[1]): color = self._get_next_cycle_color() seg = mlines.Line2D(x, y[:,j], color = color, @@ -285,7 +285,7 @@ ret.append(seg) if multicol: - for j in range(y.shape[1]): + for j in xrange(y.shape[1]): makeline(x[:,j], y[:,j]) else: makeline(x, y) @@ -324,7 +324,7 @@ closed = kwargs.get('closed', True) func = makefill if multicol: - for j in range(y.shape[1]): + for j in xrange(y.shape[1]): func(x[:,j], y[:,j]) else: func(x, y) @@ -372,7 +372,7 @@ func = makefill if multicol: - for j in range(y.shape[1]): + for j in xrange(y.shape[1]): func(x[:,j], y[:,j]) else: func(x, y) @@ -3897,9 +3897,9 @@ pass elif align == 'center': if orientation == 'vertical': - left = [left[i] - width[i]/2. for i in range(len(left))] + left = [left[i] - width[i]/2. for i in xrange(len(left))] elif orientation == 'horizontal': - bottom = [bottom[i] - height[i]/2. for i in range(len(bottom))] + bottom = [bottom[i] - height[i]/2. for i in xrange(len(bottom))] else: raise ValueError, 'invalid alignment: %s' % align @@ -4571,7 +4571,7 @@ elif nc == 1: x = [x.ravel()] else: - x = [x[:,i] for i in range(nc)] + x = [x[:,i] for i in xrange(nc)] else: raise ValueError, "input x can have no more than 2 dimensions" if not hasattr(x[0], '__len__'): @@ -4665,7 +4665,7 @@ else: def doplot(*args): shuffled = [] - for i in range(0, len(args), 3): + for i in xrange(0, len(args), 3): shuffled.extend([args[i+1], args[i], args[i+2]]) return self.plot(*shuffled) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 Re: SF.net SVN: matplotlib:[6217] trunk/matplotlib/lib/matplotlib/axes.py From: Eric Firing - 2008-10-16 19:18 Manuel, Although it doesn't hurt, I don't think it is worthwhile changing range to xrange. From the 2.5 docs: xrange( [start,] stop[, step]) This function is very similar to range(), but returns an xrange object'' instead of a list. This is an opaque sequence type which yields the same values as the corresponding list, without actually storing them all simultaneously. The advantage of xrange() over range() is minimal (since xrange() still has to create the values when asked for them) except when a very large range is used on a memory-starved machine or when all of the range's elements are never used (such as when the loop is usually terminated with break). Note "minimal" advantage. xrange was intended for special-case use, not general use. And from Python 3.0, http://docs.python.org/dev/3.0/whatsnew/3.0.html xrange() renamed to range(), so range() will no longer produce a list but an iterable yielding integers when iterated over. This implies to me that range is the preferred form, and xrange is intended to go away. Eric mmetz_bn@... wrote: > Revision: 6217 > http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6217&view=rev > Author: mmetz_bn > Date: 2008-10-16 11:15:25 +0000 (Thu, 16 Oct 2008) > > Log Message: > ----------- > minor optimizations: replacing range by xrange in for loops > > Modified Paths: > -------------- > trunk/matplotlib/lib/matplotlib/axes.py > > Modified: trunk/matplotlib/lib/matplotlib/axes.py > =================================================================== > --- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-15 20:53:09 UTC (rev 6216) > +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-16 11:15:25 UTC (rev 6217) > @@ -243,7 +243,7 @@ > x, y, multicol = self._xy_from_y(y) > > if multicol: > - for j in range(y.shape[1]): > + for j in xrange(y.shape[1]): > color = self._get_next_cycle_color() > seg = mlines.Line2D(x, y[:,j], > color = color, > @@ -285,7 +285,7 @@ > ret.append(seg) > > if multicol: > - for j in range(y.shape[1]): > + for j in xrange(y.shape[1]): > makeline(x[:,j], y[:,j]) > else: > makeline(x, y) > @@ -324,7 +324,7 @@ > closed = kwargs.get('closed', True) > func = makefill > if multicol: > - for j in range(y.shape[1]): > + for j in xrange(y.shape[1]): > func(x[:,j], y[:,j]) > else: > func(x, y) > @@ -372,7 +372,7 @@ > func = makefill > > if multicol: > - for j in range(y.shape[1]): > + for j in xrange(y.shape[1]): > func(x[:,j], y[:,j]) > else: > func(x, y) > @@ -3897,9 +3897,9 @@ > pass > elif align == 'center': > if orientation == 'vertical': > - left = [left[i] - width[i]/2. for i in range(len(left))] > + left = [left[i] - width[i]/2. for i in xrange(len(left))] > elif orientation == 'horizontal': > - bottom = [bottom[i] - height[i]/2. for i in range(len(bottom))] > + bottom = [bottom[i] - height[i]/2. for i in xrange(len(bottom))] > > else: > raise ValueError, 'invalid alignment: %s' % align > @@ -4571,7 +4571,7 @@ > elif nc == 1: > x = [x.ravel()] > else: > - x = [x[:,i] for i in range(nc)] > + x = [x[:,i] for i in xrange(nc)] > else: > raise ValueError, "input x can have no more than 2 dimensions" > if not hasattr(x[0], '__len__'): > @@ -4665,7 +4665,7 @@ > else: > def doplot(*args): > shuffled = [] > - for i in range(0, len(args), 3): > + for i in xrange(0, len(args), 3): > shuffled.extend([args[i+1], args[i], args[i+2]]) > return self.plot(*shuffled) > > > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-checkins mailing list > Matplotlib-checkins@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins 

 SF.net SVN: matplotlib:[6239] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-10-17 14:27 Revision: 6239 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6239&view=rev Author: mmetz_bn Date: 2008-10-17 14:27:28 +0000 (Fri, 17 Oct 2008) Log Message: ----------- minor hist and hist docs updates Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-17 14:27:26 UTC (rev 6238) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-17 14:27:28 UTC (rev 6239) @@ -6183,9 +6183,10 @@ Keyword arguments: *bins*: - either an integer number of bins or a sequence giving the - bins. *x* are the data to be binned. *x* can be an array or a - 2D array with multiple data in its columns. Note, if *bins* + Either an integer number of bins or a sequence giving the + bins. *x* are the data to be binned. *x* can be an array, + a 2D array with multiple data in its columns, or a list of + arrays with data of different length. Note, if *bins* is an integer input argument=numbins, *bins* + 1 bin edges will be returned, compatible with the semantics of :func:numpy.histogram with the *new* = True argument. @@ -6211,7 +6212,7 @@ gives the counts in that bin plus all bins for smaller values. The last bin gives the total number of datapoints. If *normed* is also *True* then the histogram is normalized such that the - last bin equals one. If *cumulative* evaluates to less than 0 + last bin equals 1. If *cumulative* evaluates to less than 0 (e.g. -1), the direction of accumulation is reversed. In this case, if *normed* is also *True*, then the histogram is normalized such that the first bin equals 1. @@ -6219,13 +6220,14 @@ *histtype*: [ 'bar' | 'barstacked' | 'step' | 'stepfilled' ] The type of histogram to draw. - - 'bar' is a traditional bar-type histogram + - 'bar' is a traditional bar-type histogram. If multiple data + are given the bars are aranged side by side. - 'barstacked' is a bar-type histogram where multiple - data are stacked on top of each other. + data are stacked on top of each other. - 'step' generates a lineplot that is by default - unfilled + unfilled. - 'stepfilled' generates a lineplot that is by default filled. @@ -6233,9 +6235,9 @@ *align*: ['left' | 'mid' | 'right' ] Controls how the histogram is plotted. - - 'left': bars are centered on the left bin edges + - 'left': bars are centered on the left bin edges. - - 'mid': bars are centered between the bin edges + - 'mid': bars are centered between the bin edges. - 'right': bars are centered on the right bin edges. @@ -6245,9 +6247,9 @@ the left edges. *rwidth*: - the relative width of the bars as a fraction of the bin + The relative width of the bars as a fraction of the bin width. If *None*, automatically compute the width. Ignored - if *histtype* = 'step'. + if *histtype* = 'step' or 'stepfilled'. *log*: If *True*, the histogram axis will be set to a log scale. @@ -6280,7 +6282,8 @@ 'hist now uses the rwidth to give relative width and not absolute width') try: - x = np.transpose(np.asarray(x).copy()) + # make sure a copy is created: don't use asarray + x = np.transpose(np.array(x)) if len(x.shape)==1: x.shape = (1,x.shape[0]) elif len(x.shape)==2 and x.shape[1]

 SF.net SVN: matplotlib:[6301] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-10-22 19:43 Revision: 6301 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6301&view=rev Author: efiring Date: 2008-10-22 19:43:40 +0000 (Wed, 22 Oct 2008) Log Message: ----------- When initializing a shared axes, respect limits already set on master. This is a tentative first step; more will be required. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-22 19:38:46 UTC (rev 6300) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-22 19:43:40 UTC (rev 6301) @@ -501,7 +501,6 @@ self.set_aspect('auto') self.set_adjustable('box') self.set_anchor('C') - self._sharex = sharex self._sharey = sharey if sharex is not None: @@ -523,7 +522,6 @@ self._hold = rcParams['axes.hold'] self._connected = {} # a dict from events to (id, func) self.cla() - # funcs used to format x and y - fall back on major formatters self.fmt_xdata = None self.fmt_ydata = None @@ -798,6 +796,7 @@ def cla(self): 'Clear the current axes' + # Note: this is called by Axes.__init__() self.xaxis.cla() self.yaxis.cla() @@ -805,12 +804,28 @@ self.callbacks = cbook.CallbackRegistry(('xlim_changed', 'ylim_changed')) if self._sharex is not None: + # major and minor are class instances with + # locator and formatter attributes self.xaxis.major = self._sharex.xaxis.major self.xaxis.minor = self._sharex.xaxis.minor + x0, x1 = self._sharex.get_xlim() + self.set_xlim(x0, x1, emit=False) + self.xaxis.set_scale(self._sharex.xaxis.get_scale()) + else: + self.xaxis.set_scale('linear') + if self._sharey is not None: self.yaxis.major = self._sharey.yaxis.major self.yaxis.minor = self._sharey.yaxis.minor + y0, y1 = self._sharex.get_ylim() + self.set_ylim(y0, y1, emit=False) + self.yaxis.set_scale(self._sharey.yaxis.get_scale()) + else: + self.yaxis.set_scale('linear') + self._autoscaleon = True + self._update_transScale() # needed? + self._get_lines = _process_plot_var_args(self) self._get_patches_for_fill = _process_plot_var_args(self, 'fill') @@ -824,10 +839,6 @@ self.legend_ = None self.collections = [] # collection.Collection instances - self._autoscaleon = True - self.set_xscale('linear') - self.set_yscale('linear') - self.grid(self._gridOn) props = font_manager.FontProperties(size=rcParams['axes.titlesize']) @@ -1769,10 +1780,9 @@ def get_xlim(self): """ - Get the x-axis range as a length 2 attay [*xmin*, *xmax*] + Get the x-axis range [*xmin*, *xmax*] """ - # # copy of the viewlim array to avoid modify inplace surprises - return self.viewLim.intervalx.copy() + return tuple(self.viewLim.intervalx) def set_xlim(self, xmin=None, xmax=None, emit=True, **kwargs): """ @@ -1782,7 +1792,7 @@ Set the limits for the xaxis - Returns the current xlimits as a length 2 tuple: (*xmin*, *xmax*) + Returns the current xlimits as a length 2 tuple: [*xmin*, *xmax*] Examples:: @@ -1943,10 +1953,9 @@ def get_ylim(self): """ - Get the y-axis range as a length two array [*ymin*, *ymax*] + Get the y-axis range [*ymin*, *ymax*] """ - # copy of the viewlim array to avoid modify inplace surprises - return self.viewLim.intervaly.copy() + return tuple(self.viewLim.intervaly) def set_ylim(self, ymin=None, ymax=None, emit=True, **kwargs): """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6307] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-10-23 15:42 Revision: 6307 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6307&view=rev Author: ryanmay Date: 2008-10-23 15:42:25 +0000 (Thu, 23 Oct 2008) Log Message: ----------- Tweak barbs docstring to point to the appropriate example script. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-23 15:29:50 UTC (rev 6306) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-23 15:42:25 UTC (rev 6307) @@ -5356,13 +5356,19 @@ quiver.__doc__ = mquiver.Quiver.quiver_doc def barbs(self, *args, **kw): + """ + %s + **Example:** + + .. plot:: mpl_examples/pylab_examples/barb_demo.py + """ if not self._hold: self.cla() b = mquiver.Barbs(self, *args, **kw) self.add_collection(b) self.update_datalim(b.get_offsets()) self.autoscale_view() return b - barbs.__doc__ = mquiver.Barbs.barbs_doc + barbs.__doc__ = cbook.dedent(barbs.__doc__) % mquiver.Barbs.barbs_doc def fill(self, *args, **kwargs): """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6313] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-10-23 17:36 Revision: 6313 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6313&view=rev Author: mdboom Date: 2008-10-23 17:35:50 +0000 (Thu, 23 Oct 2008) Log Message: ----------- Fix math expression. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-23 17:35:14 UTC (rev 6312) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-23 17:35:50 UTC (rev 6313) @@ -6623,7 +6623,7 @@ .. math:: - C_{xy} = \\frac{|P_{xy}|^2}{P_{xx}*P_{yy}} + C_{xy} = \\frac{|P_{xy}|^2}{P_{xx}P_{yy}} The return value is a tuple (*Cxy*, *f*), where *f* are the frequencies of the coherence vector. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6316] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-10-24 06:51 Revision: 6316 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6316&view=rev Author: efiring Date: 2008-10-24 06:51:29 +0000 (Fri, 24 Oct 2008) Log Message: ----------- Make shared axes work better with constrained aspect ratio. This is restricted to the case of adjustable=datalim, and is experimental. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-24 00:08:58 UTC (rev 6315) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-24 06:51:29 UTC (rev 6316) @@ -499,15 +499,24 @@ self._originalPosition = self._position.frozen() self.set_axes(self) self.set_aspect('auto') - self.set_adjustable('box') + self._adjustable = 'box' self.set_anchor('C') self._sharex = sharex self._sharey = sharey if sharex is not None: self._shared_x_axes.join(self, sharex) + if sharex._adjustable == 'box': + sharex._adjustable = 'datalim' + #warnings.warn( + # 'shared axes: "adjustable" is being changed to "datalim"') + self._adjustable = 'datalim' if sharey is not None: self._shared_y_axes.join(self, sharey) - + if sharex._adjustable == 'box': + sharex._adjustable = 'datalim' + #warnings.warn( + # 'shared axes: "adjustable" is being changed to "datalim"') + self._adjustable = 'datalim' self.set_label(label) self.set_figure(fig) @@ -772,6 +781,11 @@ if which in ('both', 'original'): self._originalPosition.set(pos) + def reset_position(self): + 'Make the original position the active position' + pos = self.get_position(original=True) + self.set_position(pos, which='active') + def _set_artist_props(self, a): 'set the boilerplate props for artists added to axes' a.set_figure(self.figure) @@ -992,6 +1006,10 @@ ACCEPTS: [ 'box' | 'datalim' ] """ if adjustable in ('box', 'datalim'): + if self in self._shared_x_axes or self in self._shared_y_axes: + if adjustable == 'box': + raise ValueError( + 'adjustable must be "datalim" for shared axes') self._adjustable = adjustable else: raise ValueError('argument must be "box", or "datalim"') @@ -1043,11 +1061,11 @@ axes box or the view limits. ''' if position is None: - position = self.get_position(True) + position = self.get_position(original=True) aspect = self.get_aspect() if aspect == 'auto': - self.set_position( position , 'active') + self.set_position( position , which='active') return if aspect == 'equal': @@ -1058,7 +1076,10 @@ #Ensure at drawing time that any Axes involved in axis-sharing # does not have its position changed. if self in self._shared_x_axes or self in self._shared_y_axes: - self._adjustable = 'datalim' + if self._adjustable == 'box': + self._adjustable = 'datalim' + warnings.warn( + 'shared axes: "adjustable" is being changed to "datalim"') figW,figH = self.get_figure().get_size_inches() fig_aspect = figH/figW @@ -1069,6 +1090,10 @@ self.set_position(pb1.anchored(self.get_anchor(), pb), 'active') return + # reset active to original in case it had been changed + # by prior use of 'box' + self.set_position(position, which='active') + xmin,xmax = self.get_xbound() xsize = max(math.fabs(xmax-xmin), 1e-30) ymin,ymax = self.get_ybound() @@ -1489,7 +1514,7 @@ if not self.get_visible(): return renderer.open_group('axes') - self.apply_aspect(self.get_position(True)) + self.apply_aspect() # the patch draws the background rectangle -- the frame below # will draw the edges This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6326] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-10-24 17:40 Revision: 6326 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6326&view=rev Author: efiring Date: 2008-10-24 17:40:54 +0000 (Fri, 24 Oct 2008) Log Message: ----------- Fix error in recent shared axes changes; thanks to David Trem. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-24 17:35:50 UTC (rev 6325) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-24 17:40:54 UTC (rev 6326) @@ -512,8 +512,8 @@ self._adjustable = 'datalim' if sharey is not None: self._shared_y_axes.join(self, sharey) - if sharex._adjustable == 'box': - sharex._adjustable = 'datalim' + if sharey._adjustable == 'box': + sharey._adjustable = 'datalim' #warnings.warn( # 'shared axes: "adjustable" is being changed to "datalim"') self._adjustable = 'datalim' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6329] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-10-24 22:35 Revision: 6329 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6329&view=rev Author: efiring Date: 2008-10-24 22:35:25 +0000 (Fri, 24 Oct 2008) Log Message: ----------- Another typo bug in recent commit for shared axes support Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-24 18:16:12 UTC (rev 6328) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-24 22:35:25 UTC (rev 6329) @@ -831,7 +831,7 @@ if self._sharey is not None: self.yaxis.major = self._sharey.yaxis.major self.yaxis.minor = self._sharey.yaxis.minor - y0, y1 = self._sharex.get_ylim() + y0, y1 = self._sharey.get_ylim() self.set_ylim(y0, y1, emit=False) self.yaxis.set_scale(self._sharey.yaxis.get_scale()) else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6360] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-10-31 14:54 Revision: 6360 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6360&view=rev Author: jrevans Date: 2008-10-31 14:54:42 +0000 (Fri, 31 Oct 2008) Log Message: ----------- Added unit handling for axhspan and axvspan. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-31 13:06:59 UTC (rev 6359) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-31 14:54:42 UTC (rev 6360) @@ -2876,9 +2876,16 @@ .. plot:: mpl_examples/pylab_examples/axhspan_demo.py """ - # convert y axis units trans = mtransforms.blended_transform_factory( self.transAxes, self.transData) + + # process the unit information + self._process_unit_info( [xmin, xmax], [ymin, ymax], **kwargs ) + + # first we need to strip away the units + xmin, xmax = self.convert_xunits( [xmin, xmax] ) + ymin, ymax = self.convert_yunits( [ymin, ymax] ) + verts = (xmin, ymin), (xmin, ymax), (xmax, ymax), (xmax, ymin) p = mpatches.Polygon(verts, **kwargs) p.set_transform(trans) @@ -2923,9 +2930,16 @@ :meth:axhspan: for example plot and source code """ - # convert x axis units trans = mtransforms.blended_transform_factory( self.transData, self.transAxes) + + # process the unit information + self._process_unit_info( [xmin, xmax], [ymin, ymax], **kwargs ) + + # first we need to strip away the units + xmin, xmax = self.convert_xunits( [xmin, xmax] ) + ymin, ymax = self.convert_yunits( [ymin, ymax] ) + verts = [(xmin, ymin), (xmin, ymax), (xmax, ymax), (xmax, ymin)] p = mpatches.Polygon(verts, **kwargs) p.set_transform(trans) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6364] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-11-05 15:15 Revision: 6364 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6364&view=rev Author: mdboom Date: 2008-11-05 15:15:10 +0000 (Wed, 05 Nov 2008) Log Message: ----------- Minor docstring fix. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-11-05 14:43:29 UTC (rev 6363) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-11-05 15:15:10 UTC (rev 6364) @@ -6931,23 +6931,23 @@ class SubplotBase: """ - Base class for subplots, which are Axes instances with additional - methods to facilitate generating and manipulating a set of Axes - within a figure. + Base class for subplots, which are :class:Axes instances with + additional methods to facilitate generating and manipulating a set + of :class:Axes within a figure. """ def __init__(self, fig, *args, **kwargs): """ - fig is a figure instance + *fig* is a :class:matplotlib.figure.Figure instance. - args is numRows, numCols, plotNum - where the array of subplots in the figure has dimensions - numRows, numCols, and where plotNum is the number of the - subplot being created. plotNum starts at 1 in the upper - right corner and increases to the right. + *args* is the tuple (*numRows*, *numCols*, *plotNum*), where + the array of subplots in the figure has dimensions *numRows*, + *numCols*, and where *plotNum* is the number of the subplot + being created. *plotNum* starts at 1 in the upper right + corner and increases to the right. - If numRows<=numCols<=plotNum<10, args can be the decimal - integer numRows*100 + numCols*10 + plotNum. + If *numRows* <= *numCols* <= *plotNum* < 10, *args* can be the + decimal integer *numRows* * 100 + *numCols* * 10 + *plotNum*. """ self.figure = fig @@ -6982,7 +6982,7 @@ # COVERAGE NOTE: Never used internally or from examples def change_geometry(self, numrows, numcols, num): - 'change subplot geometry, eg from 1,1,1 to 2,2,3' + 'change subplot geometry, eg. from 1,1,1 to 2,2,3' self._rows = numrows self._cols = numcols self._num = num-1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6377] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-11-08 18:41 Revision: 6377 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6377&view=rev Author: efiring Date: 2008-11-08 18:41:25 +0000 (Sat, 08 Nov 2008) Log Message: ----------- Fix bugs in unit-handling in axhspan and axvspan Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-11-08 18:33:01 UTC (rev 6376) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-11-08 18:41:25 UTC (rev 6377) @@ -2880,7 +2880,7 @@ self.transAxes, self.transData) # process the unit information - self._process_unit_info( [xmin, xmax], [ymin, ymax], **kwargs ) + self._process_unit_info( [xmin, xmax], [ymin, ymax], kwargs=kwargs ) # first we need to strip away the units xmin, xmax = self.convert_xunits( [xmin, xmax] ) @@ -2934,7 +2934,7 @@ self.transData, self.transAxes) # process the unit information - self._process_unit_info( [xmin, xmax], [ymin, ymax], **kwargs ) + self._process_unit_info( [xmin, xmax], [ymin, ymax], kwargs=kwargs ) # first we need to strip away the units xmin, xmax = self.convert_xunits( [xmin, xmax] ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6382] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-11-09 13:17 Revision: 6382 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6382&view=rev Author: jouni Date: 2008-11-09 13:17:41 +0000 (Sun, 09 Nov 2008) Log Message: ----------- Clarify hist docstring Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-11-09 13:16:39 UTC (rev 6381) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-11-09 13:17:41 UTC (rev 6382) @@ -6243,8 +6243,8 @@ bottom=None, histtype='bar', align='mid', orientation='vertical', rwidth=None, log=False, **kwargs) - Compute the histogram of *x*. The return value is a tuple - (*n*, *bins*, *patches*) or ([*n0*, *n1*, ...], *bins*, + Compute and draw the histogram of *x*. The return value is a + tuple (*n*, *bins*, *patches*) or ([*n0*, *n1*, ...], *bins*, [*patches0*, *patches1*,...]) if the input contains multiple data. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6386] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-11-10 22:41 Revision: 6386 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6386&view=rev Author: ryanmay Date: 2008-11-10 22:41:27 +0000 (Mon, 10 Nov 2008) Log Message: ----------- Clean up some of axes.psd() docstring. Add a reference to the psd_demo.py example. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-11-10 18:59:18 UTC (rev 6385) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-11-10 22:41:27 UTC (rev 6386) @@ -6526,7 +6526,7 @@ The power spectral density by Welches average periodogram method. The vector *x* is divided into *NFFT* length segments. Each segment is detrended by function *detrend* and - windowed by function *window*. *noperlap* gives the length of + windowed by function *window*. *noverlap* gives the length of the overlap between segments. The :math:|\mathrm{fft}(i)|^2 of each segment :math:i are averaged to compute *Pxx*, with a scaling to correct for power loss due to windowing. *Fs* is the @@ -6542,7 +6542,7 @@ *Fc*: integer The center frequency of *x* (defaults to 0), which offsets - the yextents of the image to reflect the frequency range used + the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband. @@ -6580,6 +6580,10 @@ kwargs control the :class:~matplotlib.lines.Line2D properties: %(Line2D)s + + **Example:** + + .. plot:: mpl_examples/pylab_examples/psd_demo.py """ if not self._hold: self.cla() pxx, freqs = mlab.psd(x, NFFT, Fs, detrend, window, noverlap) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6388] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-11-11 08:04 Revision: 6388 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6388&view=rev Author: efiring Date: 2008-11-11 08:04:24 +0000 (Tue, 11 Nov 2008) Log Message: ----------- Fix autoscaling problem caused by axhline and axvline Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-11-11 06:52:52 UTC (rev 6387) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-11-11 08:04:24 UTC (rev 6388) @@ -1312,7 +1312,8 @@ self._set_artist_props(line) line.set_clip_path(self.patch) - self._update_line_limits(line) + if line.get_transform() == self.transData: + self._update_line_limits(line) if not line.get_label(): line.set_label('_line%d'%len(self.lines)) self.lines.append(line) @@ -2774,7 +2775,11 @@ trans = mtransforms.blended_transform_factory( self.transAxes, self.transData) - l, = self.plot([xmin,xmax], [y,y], transform=trans, scalex=False, scaley=scaley, **kwargs) + l = mlines.Line2D([xmin,xmax], [y,y], transform=trans, **kwargs) + self.add_line(l) + self.dataLim.y0 = min(self.dataLim.y0, yy) + self.dataLim.y1 = max(self.dataLim.y1, yy) + self.autoscale_view(scalex=False, scaley=scaley) return l @@ -2830,7 +2835,11 @@ trans = mtransforms.blended_transform_factory( self.transData, self.transAxes) - l, = self.plot([x,x], [ymin,ymax] , transform=trans, scalex=scalex, scaley=False, **kwargs) + l = mlines.Line2D([x,x], [ymin,ymax] , transform=trans, **kwargs) + self.add_line(l) + self.dataLim.x0 = min(self.dataLim.x0, xx) + self.dataLim.x1 = max(self.dataLim.x1, xx) + self.autoscale_view(scalex=scalex, scaley=False) return l This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6440] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-11-23 20:15 Revision: 6440 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6440&view=rev Author: jdh2358 Date: 2008-11-23 20:15:36 +0000 (Sun, 23 Nov 2008) Log Message: ----------- fixed datalim update for fill_between Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-11-23 20:09:08 UTC (rev 6439) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-11-23 20:15:36 UTC (rev 6440) @@ -5559,8 +5559,14 @@ collection = mcoll.PolyCollection(polys, **kwargs) - self.update_datalim_numerix(x[where], y1[where]) - self.update_datalim_numerix(x[where], y2[where]) + # now update the datalim and autoscale + XY1 = np.array([x[where], y1[where]]).T + XY2 = np.array([x[where], y2[where]]).T + self.dataLim.update_from_data_xy(XY1, self.ignore_existing_data_limits, + updatex=True, updatey=True) + + self.dataLim.update_from_data_xy(XY2, self.ignore_existing_data_limits, + updatex=False, updatey=True) self.add_collection(collection) self.autoscale_view() return collection This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6458] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-11-30 18:34 Revision: 6458 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6458&view=rev Author: astraw Date: 2008-11-30 18:33:55 +0000 (Sun, 30 Nov 2008) Log Message: ----------- axes.py: Shorten source code lines so all are less than 80 chars long. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-11-29 21:14:26 UTC (rev 6457) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-11-30 18:33:55 UTC (rev 6458) @@ -266,7 +266,8 @@ ret = [] if is_string_like(tup2[1]): - assert self.command == 'plot', 'fill needs at least 2 non-string arguments' + assert self.command == 'plot', ('fill needs at least 2 non-string ' + 'arguments') y, fmt = tup2 x, y, multicol = self._xy_from_y(y) @@ -545,10 +546,12 @@ if len(kwargs): martist.setp(self, **kwargs) if self.xaxis is not None: - self._xcid = self.xaxis.callbacks.connect('units finalize', self.relim) + self._xcid = self.xaxis.callbacks.connect('units finalize', + self.relim) if self.yaxis is not None: - self._ycid = self.yaxis.callbacks.connect('units finalize', self.relim) + self._ycid = self.yaxis.callbacks.connect('units finalize', + self.relim) def get_window_extent(self, *args, **kwargs): ''' @@ -575,7 +578,8 @@ #these will be updated later as data is added self.dataLim = mtransforms.Bbox.unit() self.viewLim = mtransforms.Bbox.unit() - self.transScale = mtransforms.TransformWrapper(mtransforms.IdentityTransform()) + self.transScale = mtransforms.TransformWrapper( + mtransforms.IdentityTransform()) self._set_lim_and_transforms() @@ -590,7 +594,8 @@ # Transforms the x and y axis separately by a scale factor # It is assumed that this part will have non-linear components - self.transScale = mtransforms.TransformWrapper(mtransforms.IdentityTransform()) + self.transScale = mtransforms.TransformWrapper( + mtransforms.IdentityTransform()) # An affine transformation on the data, generally to limit the # range of the axes @@ -815,7 +820,8 @@ self.yaxis.cla() self.ignore_existing_data_limits = True - self.callbacks = cbook.CallbackRegistry(('xlim_changed', 'ylim_changed')) + self.callbacks = cbook.CallbackRegistry(('xlim_changed', + 'ylim_changed')) if self._sharex is not None: # major and minor are class instances with @@ -1128,7 +1134,8 @@ changey = (self in self._shared_x_axes and self not in self._shared_y_axes) if changex and changey: - warnings.warn("adjustable='datalim' cannot work with shared x and y axes") + warnings.warn("adjustable='datalim' cannot work with shared " + "x and y axes") return if changex: adjust_y = False @@ -1187,7 +1194,8 @@ self.set_aspect('equal', adjustable='box', anchor='C') else: - raise ValueError('Unrecognized string %s to axis; try on or off' % s) + raise ValueError('Unrecognized string %s to axis; ' + 'try on or off' % s) xmin, xmax = self.get_xlim() ymin, ymax = self.get_ylim() return xmin, xmax, ymin, ymax @@ -1439,7 +1447,8 @@ if xunits!=self.xaxis.units: #print '\tkw setting xunits', xunits self.xaxis.set_units(xunits) - # If the units being set imply a different converter, we need to update. + # If the units being set imply a different converter, + # we need to update. if xdata is not None: self.xaxis.update_units(xdata) @@ -1447,7 +1456,8 @@ if yunits!=self.yaxis.units: #print '\tkw setting yunits', yunits self.yaxis.set_units(yunits) - # If the units being set imply a different converter, we need to update. + # If the units being set imply a different converter, + # we need to update. if ydata is not None: self.yaxis.update_units(ydata) @@ -1875,7 +1885,8 @@ for other in self._shared_x_axes.get_siblings(self): if other is not self: other.set_xlim(self.viewLim.intervalx, emit=False) - if other.figure != self.figure and other.figure.canvas is not None: + if (other.figure != self.figure and + other.figure.canvas is not None): other.figure.canvas.draw_idle() return xmin, xmax @@ -1920,15 +1931,18 @@ def get_xmajorticklabels(self): 'Get the xtick labels as a list of Text instances' - return cbook.silent_list('Text xticklabel', self.xaxis.get_majorticklabels()) + return cbook.silent_list('Text xticklabel', + self.xaxis.get_majorticklabels()) def get_xminorticklabels(self): 'Get the xtick labels as a list of Text instances' - return cbook.silent_list('Text xticklabel', self.xaxis.get_minorticklabels()) + return cbook.silent_list('Text xticklabel', + self.xaxis.get_minorticklabels()) def get_xticklabels(self, minor=False): 'Get the xtick labels as a list of Text instances' - return cbook.silent_list('Text xticklabel', self.xaxis.get_ticklabels(minor=minor)) + return cbook.silent_list('Text xticklabel', + self.xaxis.get_ticklabels(minor=minor)) def set_xticklabels(self, labels, fontdict=None, minor=False, **kwargs): """ @@ -1945,8 +1959,10 @@ ACCEPTS: sequence of strings """ - return self.xaxis.set_ticklabels(labels, fontdict, minor=minor, **kwargs) - set_xticklabels.__doc__ = cbook.dedent(set_xticklabels.__doc__) % martist.kwdocd + return self.xaxis.set_ticklabels(labels, fontdict, + minor=minor, **kwargs) + set_xticklabels.__doc__ = cbook.dedent( + set_xticklabels.__doc__) % martist.kwdocd def invert_yaxis(self): "Invert the y-axis." @@ -1959,7 +1975,7 @@ return right < left def get_ybound(self): - "Returns the y-axis numerical bounds in the form of lowerBound < upperBound" + "Return y-axis numerical bounds in the form of lowerBound < upperBound" left, right = self.get_ylim() if left < right: return left, right @@ -2044,7 +2060,8 @@ for other in self._shared_y_axes.get_siblings(self): if other is not self: other.set_ylim(self.viewLim.intervaly, emit=False) - if other.figure != self.figure and other.figure.canvas is not None: + if (other.figure != self.figure and + other.figure.canvas is not None): other.figure.canvas.draw_idle() return ymin, ymax @@ -2093,15 +2110,18 @@ def get_ymajorticklabels(self): 'Get the xtick labels as a list of Text instances' - return cbook.silent_list('Text yticklabel', self.yaxis.get_majorticklabels()) + return cbook.silent_list('Text yticklabel', + self.yaxis.get_majorticklabels()) def get_yminorticklabels(self): 'Get the xtick labels as a list of Text instances' - return cbook.silent_list('Text yticklabel', self.yaxis.get_minorticklabels()) + return cbook.silent_list('Text yticklabel', + self.yaxis.get_minorticklabels()) def get_yticklabels(self, minor=False): 'Get the xtick labels as a list of Text instances' - return cbook.silent_list('Text yticklabel', self.yaxis.get_ticklabels(minor=minor)) + return cbook.silent_list('Text yticklabel', + self.yaxis.get_ticklabels(minor=minor)) def set_yticklabels(self, labels, fontdict=None, minor=False, **kwargs): """ @@ -2118,8 +2138,10 @@ ACCEPTS: sequence of strings """ - return self.yaxis.set_ticklabels(labels, fontdict, minor=minor, **kwargs) - set_yticklabels.__doc__ = cbook.dedent(set_yticklabels.__doc__) % martist.kwdocd + return self.yaxis.set_ticklabels(labels, fontdict, + minor=minor, **kwargs) + set_yticklabels.__doc__ = cbook.dedent( + set_yticklabels.__doc__) % martist.kwdocd def xaxis_date(self, tz=None): """Sets up x-axis ticks and labels that treat the x data as dates. @@ -2412,11 +2434,13 @@ disconnect to disconnect from the axes event """ - raise DeprecationWarning('use the callbacks CallbackRegistry instance instead') + raise DeprecationWarning('use the callbacks CallbackRegistry instance ' + 'instead') def disconnect(self, cid): 'disconnect from the Axes event.' - raise DeprecationWarning('use the callbacks CallbackRegistry instance instead') + raise DeprecationWarning('use the callbacks CallbackRegistry instance ' + 'instead') def get_children(self): 'return a list of child artists' @@ -2456,8 +2480,8 @@ the artist and the artist has picker set """ if len(args)>1: - raise DeprecationWarning( - 'New pick API implemented -- see API_CHANGES in the src distribution') + raise DeprecationWarning('New pick API implemented -- ' + 'see API_CHANGES in the src distribution') martist.Artist.pick(self,args[0]) def __pick(self, x, y, trans=None, among=None): @@ -2773,7 +2797,8 @@ ymin, ymax = self.get_ybound() - # We need to strip away the units for comparison with non-unitized bounds + # We need to strip away the units for comparison with + # non-unitized bounds yy = self.convert_yunits( y ) scaley = (yyymax) @@ -2831,7 +2856,8 @@ xmin, xmax = self.get_xbound() - # We need to strip away the units for comparison with non-unitized bounds + # We need to strip away the units for comparison with + # non-unitized bounds xx = self.convert_xunits( x ) scalex = (xxxmax) @@ -2993,8 +3019,9 @@ .. plot:: mpl_examples/pylab_examples/hline_demo.py """ if kwargs.get('fmt') is not None: - raise DeprecationWarning( - 'hlines now uses a collections.LineCollection and not a list of Line2D to draw; see API_CHANGES') + raise DeprecationWarning('hlines now uses a ' + 'collections.LineCollection and not a ' + 'list of Line2D to draw; see API_CHANGES') # We do the conversion first since not all unitized data is uniform y = self.convert_yunits( y ) @@ -3069,8 +3096,9 @@ """ if kwargs.get('fmt') is not None: - raise DeprecationWarning( - 'vlines now uses a collections.LineCollection and not a list of Line2D to draw; see API_CHANGES') + raise DeprecationWarning('vlines now uses a ' + 'collections.LineCollection and not a ' + 'list of Line2D to draw; see API_CHANGES') self._process_unit_info(xdata=x, ydata=ymin, kwargs=kwargs) @@ -3128,10 +3156,10 @@ optional format string. For example, each of the following is legal:: - plot(x, y) # plot x and y using the default line style and color - plot(x, y, 'bo') # plot x and y using blue circle markers - plot(y) # plot y using x as index array 0..N-1 - plot(y, 'r+') # ditto, but with red plusses + plot(x, y) # plot x and y using default line style and color + plot(x, y, 'bo') # plot x and y using blue circle markers + plot(y) # plot y using x as index array 0..N-1 + plot(y, 'r+') # ditto, but with red plusses If *x* and/or *y* is 2-dimensional, then the corresponding columns will be plotted. @@ -3247,8 +3275,8 @@ the *x* or *y* (or both) data is considered to be dates, and the axis is labeled accordingly. - *x* and/or *y* can be a sequence of dates represented as float days since - 0001-01-01 UTC. + *x* and/or *y* can be a sequence of dates represented as float + days since 0001-01-01 UTC. Keyword arguments: @@ -3317,7 +3345,8 @@ :func:~matplotlib.pyplot.loglog supports all the keyword arguments of :func:~matplotlib.pyplot.plot and - :meth:matplotlib.axes.Axes.set_xscale/:meth:matplotlib.axes.Axes.set_yscale. + :meth:matplotlib.axes.Axes.set_xscale / + :meth:matplotlib.axes.Axes.set_yscale. Notable keyword arguments: @@ -3327,9 +3356,8 @@ *subsx*/*subsy*: [ None | sequence ] the location of the minor *x*/*y* ticks; *None* defaults to autosubs, which depend on the number of decades in the - plot; see - :meth:matplotlib.axes.Axes.set_xscale/:meth:matplotlib.axes.Axes.set_yscale - for details + plot; see :meth:matplotlib.axes.Axes.set_xscale / + :meth:matplotlib.axes.Axes.set_yscale for details The remaining valid kwargs are :class:~matplotlib.lines.Line2D properties: @@ -3497,8 +3525,9 @@ - *b* is the *x*-axis. .. seealso:: - :meth:~matplotlib.axes.Axes.plot or :meth:~matplotlib.axes.Axes.vlines: - For documentation on valid kwargs. + :meth:~matplotlib.axes.Axes.plot or + :meth:~matplotlib.axes.Axes.vlines: For documentation on + valid kwargs. **Example:** @@ -3512,8 +3541,8 @@ return self.xcorr(x, x, **kwargs) acorr.__doc__ = cbook.dedent(acorr.__doc__) % martist.kwdocd - def xcorr(self, x, y, normed=False, detrend=mlab.detrend_none, usevlines=False, - maxlags=None, **kwargs): + def xcorr(self, x, y, normed=False, detrend=mlab.detrend_none, + usevlines=False, maxlags=None, **kwargs): """ call signature:: @@ -3581,7 +3610,8 @@ if maxlags is None: maxlags = Nx - 1 if maxlags >= Nx or maxlags < 1: - raise ValueError('maglags must be None or strictly positive < %d'%Nx) + raise ValueError('maglags must be None or strictly ' + 'positive < %d'%Nx) lags = np.arange(-maxlags,maxlags+1) c = c[Nx-1-maxlags:Nx+maxlags] @@ -3723,11 +3753,13 @@ labels = [] for handle in get_handles(): label = handle.get_label() - if label is not None and label != '' and not label.startswith('_'): + if (label is not None and + label != '' and not label.startswith('_')): handles.append(handle) labels.append(label) if len(handles) == 0: - warnings.warn("No labeled objects found. Use label='...' kwarg on individual plots.") + warnings.warn("No labeled objects found. " + "Use label='...' kwarg on individual plots.") return None elif len(args)==1: @@ -3784,7 +3816,8 @@ where = kwargs.pop('where', 'pre') if where not in ('pre', 'post', 'mid'): - raise ValueError("'where' argument to step must be 'pre', 'post' or 'mid'") + raise ValueError("'where' argument to step must be " + "'pre', 'post' or 'mid'") kwargs['linestyle'] = 'steps-' + where return self.plot(x, y, *args, **kwargs) @@ -3960,18 +3993,24 @@ # FIXME: convert the following to proper input validation # raising ValueError; don't use assert for this. assert len(left)==nbars, "argument 'left' must be %d or scalar" % nbars - assert len(height)==nbars, "argument 'height' must be %d or scalar" % nbars - assert len(width)==nbars, "argument 'width' must be %d or scalar" % nbars - assert len(bottom)==nbars, "argument 'bottom' must be %d or scalar" % nbars + assert len(height)==nbars, ("argument 'height' must be %d or scalar" % + nbars) + assert len(width)==nbars, ("argument 'width' must be %d or scalar" % + nbars) + assert len(bottom)==nbars, ("argument 'bottom' must be %d or scalar" % + nbars) if yerr is not None and len(yerr)!=nbars: - raise ValueError("bar() argument 'yerr' must be len(%s) or scalar" % nbars) + raise ValueError( + "bar() argument 'yerr' must be len(%s) or scalar" % nbars) if xerr is not None and len(xerr)!=nbars: - raise ValueError("bar() argument 'xerr' must be len(%s) or scalar" % nbars) + raise ValueError( + "bar() argument 'xerr' must be len(%s) or scalar" % nbars) patches = [] - # lets do some conversions now since some types cannot be subtracted uniformly + # lets do some conversions now since some types cannot be + # subtracted uniformly if self.xaxis is not None: xconv = self.xaxis.converter if xconv is not None: @@ -4189,12 +4228,13 @@ *baseline*). .. seealso:: - this document - _: - for details + this document__ for details :file:examples/pylab_examples/stem_plot.py: for a demo + + __ http://www.mathworks.com/access/helpdesk/help/techdoc/ref/stem.html + """ remember_hold=self._hold if not self._hold: self.cla() @@ -4344,7 +4384,8 @@ elif callable(autopct): s = autopct(100.*frac) else: - raise TypeError('autopct must be callable or a format string') + raise TypeError( + 'autopct must be callable or a format string') t = self.text(xt, yt, s, horizontalalignment='center', @@ -4449,7 +4490,8 @@ self._process_unit_info(xdata=x, ydata=y, kwargs=kwargs) if not self._hold: self.cla() - # make sure all the args are iterable; use lists not arrays to preserve units + # make sure all the args are iterable; use lists not arrays to + # preserve units if not iterable(x): x = [x] @@ -4521,14 +4563,19 @@ plot_kw['transform'] = kwargs['transform'] if xerr is not None: - if iterable(xerr) and len(xerr)==2 and iterable(xerr[0]) and iterable(xerr[1]): + if (iterable(xerr) and len(xerr)==2 and + iterable(xerr[0]) and iterable(xerr[1])): # using list comps rather than arrays to preserve units - left = [thisx-thiserr for (thisx, thiserr) in cbook.safezip(x,xerr[0])] - right = [thisx+thiserr for (thisx, thiserr) in cbook.safezip(x,xerr[1])] + left = [thisx-thiserr for (thisx, thiserr) + in cbook.safezip(x,xerr[0])] + right = [thisx+thiserr for (thisx, thiserr) + in cbook.safezip(x,xerr[1])] else: # using list comps rather than arrays to preserve units - left = [thisx-thiserr for (thisx, thiserr) in cbook.safezip(x,xerr)] - right = [thisx+thiserr for (thisx, thiserr) in cbook.safezip(x,xerr)] + left = [thisx-thiserr for (thisx, thiserr) + in cbook.safezip(x,xerr)] + right = [thisx+thiserr for (thisx, thiserr) + in cbook.safezip(x,xerr)] barcols.append( self.hlines(y, left, right, **lines_kw ) ) if capsize > 0: @@ -4537,7 +4584,9 @@ # y are lists leftlo, ylo = xywhere(left, y, xlolims) - caplines.extend( self.plot(leftlo, ylo, ls='None', marker=mlines.CARETLEFT, **plot_kw) ) + caplines.extend( + self.plot(leftlo, ylo, ls='None', + marker=mlines.CARETLEFT, **plot_kw) ) xlolims = ~xlolims leftlo, ylo = xywhere(left, y, xlolims) caplines.extend( self.plot(leftlo, ylo, 'k|', **plot_kw) ) @@ -4547,7 +4596,9 @@ if xuplims.any(): rightup, yup = xywhere(right, y, xuplims) - caplines.extend( self.plot(rightup, yup, ls='None', marker=mlines.CARETRIGHT, **plot_kw) ) + caplines.extend( + self.plot(rightup, yup, ls='None', + marker=mlines.CARETRIGHT, **plot_kw) ) xuplims = ~xuplims rightup, yup = xywhere(right, y, xuplims) caplines.extend( self.plot(rightup, yup, 'k|', **plot_kw) ) @@ -4555,21 +4606,28 @@ caplines.extend( self.plot(right, y, 'k|', **plot_kw) ) if yerr is not None: - if iterable(yerr) and len(yerr)==2 and iterable(yerr[0]) and iterable(yerr[1]): + if (iterable(yerr) and len(yerr)==2 and + iterable(yerr[0]) and iterable(yerr[1])): # using list comps rather than arrays to preserve units - lower = [thisy-thiserr for (thisy, thiserr) in cbook.safezip(y,yerr[0])] - upper = [thisy+thiserr for (thisy, thiserr) in cbook.safezip(y,yerr[1])] + lower = [thisy-thiserr for (thisy, thiserr) + in cbook.safezip(y,yerr[0])] + upper = [thisy+thiserr for (thisy, thiserr) + in cbook.safezip(y,yerr[1])] else: # using list comps rather than arrays to preserve units - lower = [thisy-thiserr for (thisy, thiserr) in cbook.safezip(y,yerr)] - upper = [thisy+thiserr for (thisy, thiserr) in cbook.safezip(y,yerr)] + lower = [thisy-thiserr for (thisy, thiserr) + in cbook.safezip(y,yerr)] + upper = [thisy+thiserr for (thisy, thiserr) + in cbook.safezip(y,yerr)] barcols.append( self.vlines(x, lower, upper, **lines_kw) ) if capsize > 0: if lolims.any(): xlo, lowerlo = xywhere(x, lower, lolims) - caplines.extend( self.plot(xlo, lowerlo, ls='None', marker=mlines.CARETDOWN, **plot_kw) ) + caplines.extend( + self.plot(xlo, lowerlo, ls='None', + marker=mlines.CARETDOWN, **plot_kw) ) lolims = ~lolims xlo, lowerlo = xywhere(x, lower, lolims) caplines.extend( self.plot(xlo, lowerlo, 'k_', **plot_kw) ) @@ -4579,7 +4637,9 @@ if uplims.any(): xup, upperup = xywhere(x, upper, uplims) - caplines.extend( self.plot(xup, upperup, ls='None', marker=mlines.CARETUP, **plot_kw) ) + caplines.extend( + self.plot(xup, upperup, ls='None', + marker=mlines.CARETUP, **plot_kw) ) uplims = ~uplims xup, upperup = xywhere(x, upper, uplims) caplines.extend( self.plot(xup, upperup, 'k_', **plot_kw) ) @@ -4962,8 +5022,9 @@ edgecolors = None else: edgecolors = 'none' - warnings.warn('''replace "faceted=False" with "edgecolors='none'"''', - DeprecationWarning) #2008/04/18 + warnings.warn( + '''replace "faceted=False" with "edgecolors='none'"''', + DeprecationWarning) #2008/04/18 sym = None symstyle = 0 @@ -5302,7 +5363,8 @@ else: lattice2[i,j] = np.nan - accum = np.hstack(( lattice1.astype(float).ravel(), lattice2.astype(float).ravel() )) + accum = np.hstack(( + lattice1.astype(float).ravel(), lattice2.astype(float).ravel())) good_idxs = ~np.isnan(accum) px = xmin + sx * np.array([ 0.5, 0.5, 0.0, -0.5, -0.5, 0.0]) @@ -5734,7 +5796,8 @@ Y = y.repeat(Nx, axis=1) if X.shape != Y.shape: raise TypeError( - 'Incompatible X, Y inputs to %s; see help(%s)' % (funcname, funcname)) + 'Incompatible X, Y inputs to %s; see help(%s)' % ( + funcname, funcname)) return X, Y, C def pcolor(self, *args, **kwargs): @@ -6025,7 +6088,8 @@ Ny, Nx = X.shape # convert to one dimensional arrays - C = ma.ravel(C[0:Ny-1, 0:Nx-1]) # data point in each cell is value at lower left corner + C = ma.ravel(C[0:Ny-1, 0:Nx-1]) # data point in each cell is value at + # lower left corner X = X.ravel() Y = Y.ravel() @@ -6039,7 +6103,8 @@ showedges = 0 collection = mcoll.QuadMesh( - Nx - 1, Ny - 1, coords, showedges, antialiased=antialiased) # kwargs are not used + Nx - 1, Ny - 1, coords, showedges, + antialiased=antialiased) # kwargs are not used collection.set_alpha(alpha) collection.set_array(C) if norm is not None: assert(isinstance(norm, mcolors.Normalize)) @@ -6184,7 +6249,8 @@ # convert to one dimensional arrays # This should also be moved to the QuadMesh class - C = ma.ravel(C) # data point in each cell is value at lower left corner + C = ma.ravel(C) # data point in each cell is value + # at lower left corner X = x.ravel() Y = y.ravel() Nx = nc+1 @@ -6446,7 +6512,8 @@ if kwargs.get('width') is not None: raise DeprecationWarning( - 'hist now uses the rwidth to give relative width and not absolute width') + 'hist now uses the rwidth to give relative width ' + 'and not absolute width') try: # make sure a copy is created: don't use asarray @@ -6454,7 +6521,8 @@ if len(x.shape)==1: x.shape = (1,x.shape[0]) elif len(x.shape)==2 and x.shape[1]precision if 'cmap' not in kwargs: - kwargs['cmap'] = mcolors.ListedColormap(['w', 'k'], name='binary') + kwargs['cmap'] = mcolors.ListedColormap(['w', 'k'], + name='binary') nr, nc = Z.shape extent = [-0.5, nc-0.5, nr-0.5, -0.5] ret = self.imshow(mask, interpolation='nearest', aspect=aspect, @@ -7072,7 +7141,8 @@ total = rows*cols - num -= 1 # convert from matlab to python indexing ie num in range(0,total) + num -= 1 # convert from matlab to python indexing + # ie num in range(0,total) if num >= total: raise ValueError( 'Subplot number exceeds total subplots') self._rows = rows @@ -7125,7 +7195,8 @@ figBottom = top - (rowNum+1)*figH - rowNum*sepH figLeft = left + colNum*(figW + sepW) - self.figbox = mtransforms.Bbox.from_bounds(figLeft, figBottom, figW, figH) + self.figbox = mtransforms.Bbox.from_bounds(figLeft, figBottom, + figW, figH) self.rowNum = rowNum self.colNum = colNum self.numRows = rows This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6493] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-12-04 22:15 Revision: 6493 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6493&view=rev Author: ryanmay Date: 2008-12-04 22:13:57 +0000 (Thu, 04 Dec 2008) Log Message: ----------- Replace tabs in indentation with spaces. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-04 21:02:36 UTC (rev 6492) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-04 22:13:57 UTC (rev 6493) @@ -5579,14 +5579,14 @@ """ x = np.asarray(x) - if not cbook.iterable(y1): - y1 = np.ones_like(x)*y1 + if not cbook.iterable(y1): + y1 = np.ones_like(x)*y1 - if not cbook.iterable(y2): - y2 = np.ones_like(x)*y2 + if not cbook.iterable(y2): + y2 = np.ones_like(x)*y2 - if where is None: - where = np.ones(len(x), np.bool) + if where is None: + where = np.ones(len(x), np.bool) y1 = np.asarray(y1) y2 = np.asarray(y2) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6496] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-12-05 14:48 Revision: 6496 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6496&view=rev Author: mmetz_bn Date: 2008-12-05 14:48:45 +0000 (Fri, 05 Dec 2008) Log Message: ----------- hist docstring updated & exception added Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-05 00:08:43 UTC (rev 6495) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-05 14:48:45 UTC (rev 6496) @@ -6430,6 +6430,10 @@ are ignored. If not provided, *range* is (x.min(), x.max()). Range has no effect if *bins* is a sequence. + If *bins* is a sequence or *range* is specified, autoscaling is + set off (*autoscale_on* is set to *False*) and the xaxis limits + are set to encompass the full specified bin range. + *normed*: If *True*, the first element of the return tuple will be the counts normalized to form a probability density, i.e., @@ -6533,6 +6537,8 @@ for i in xrange(len(x)): tx.append( np.array(x[i]) ) x = tx + else: + raise ValueError, 'Can not use providet data to create a histogram' # Check whether bins or range are given explicitly. In that # case do not autoscale axes. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6497] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-12-05 15:56 Revision: 6497 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6497&view=rev Author: ryanmay Date: 2008-12-05 15:56:26 +0000 (Fri, 05 Dec 2008) Log Message: ----------- Add support for data with units to Axes.fill_between(). Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-05 14:48:45 UTC (rev 6496) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-05 15:56:26 UTC (rev 6497) @@ -5578,7 +5578,15 @@ %(PolyCollection)s """ - x = np.asarray(x) + # Handle united data, such as dates + self._process_unit_info(xdata=x, ydata=y1, kwargs=kwargs) + self._process_unit_info(ydata=y2) + + # Convert the arrays so we can work with them + x = np.asarray(self.convert_xunits(x)) + y1 = np.asarray(self.convert_yunits(y1)) + y2 = np.asarray(self.convert_yunits(y2)) + if not cbook.iterable(y1): y1 = np.ones_like(x)*y1 @@ -5588,8 +5596,6 @@ if where is None: where = np.ones(len(x), np.bool) - y1 = np.asarray(y1) - y2 = np.asarray(y2) where = np.asarray(where) assert( (len(x)==len(y1)) and (len(x)==len(y2)) and len(x)==len(where)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6504] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-12-07 20:52 Revision: 6504 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6504&view=rev Author: leejjoon Date: 2008-12-07 20:52:13 +0000 (Sun, 07 Dec 2008) Log Message: ----------- axes.py : a slight change in the numpy version checking code Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-07 20:40:12 UTC (rev 6503) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-07 20:52:13 UTC (rev 6504) @@ -6551,8 +6551,7 @@ binsgiven = (cbook.iterable(bins) or range != None) # check the version of the numpy - np_version = float(".".join(np.__version__.split(".")[:2])) - if np_version < 1.2: # version 1.1 + if np.__version__ < "1.2": # version 1.1 hist_kwargs = dict(range=range, normed=bool(normed), new=True) else: # version 1.2 and later, drop new=True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6521] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-12-08 21:27 Revision: 6521 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6521&view=rev Author: ryanmay Date: 2008-12-08 21:27:40 +0000 (Mon, 08 Dec 2008) Log Message: ----------- Remove trailing whitespace. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-08 21:23:04 UTC (rev 6520) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-08 21:27:40 UTC (rev 6521) @@ -6521,7 +6521,7 @@ if not self._hold: self.cla() # NOTE: the range keyword overwrites the built-in func range !!! - # needs to be fixed in with numpy !!! + # needs to be fixed in with numpy !!! if kwargs.get('width') is not None: raise DeprecationWarning( @@ -6551,7 +6551,7 @@ binsgiven = (cbook.iterable(bins) or range != None) # check the version of the numpy - if np.__version__ < "1.2": # version 1.1 + if np.__version__ < "1.2": # version 1.1 hist_kwargs = dict(range=range, normed=bool(normed), new=True) else: # version 1.2 and later, drop new=True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6532] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-12-09 04:12 Revision: 6532 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6532&view=rev Author: ryanmay Date: 2008-12-09 04:12:34 +0000 (Tue, 09 Dec 2008) Log Message: ----------- Fix typo in docstring. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-09 03:51:35 UTC (rev 6531) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-09 04:12:34 UTC (rev 6532) @@ -5548,7 +5548,7 @@ fill_between(x, y1, y2=0, where=None, **kwargs) - Create a :class:~matplotlib.collectionsPolyCollection + Create a :class:~matplotlib.collections.PolyCollection filling the regions between *y1* and *y2* where where==True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6534] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-12-09 10:23 Revision: 6534 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6534&view=rev Author: mmetz_bn Date: 2008-12-09 10:23:53 +0000 (Tue, 09 Dec 2008) Log Message: ----------- typo in subplot docs Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-09 04:39:50 UTC (rev 6533) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-09 10:23:53 UTC (rev 6534) @@ -7163,7 +7163,7 @@ *args* is the tuple (*numRows*, *numCols*, *plotNum*), where the array of subplots in the figure has dimensions *numRows*, *numCols*, and where *plotNum* is the number of the subplot - being created. *plotNum* starts at 1 in the upper right + being created. *plotNum* starts at 1 in the upper left corner and increases to the right. If *numRows* <= *numCols* <= *plotNum* < 10, *args* can be the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6548] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-12-10 15:02 Revision: 6548 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6548&view=rev Author: jdh2358 Date: 2008-12-10 15:02:14 +0000 (Wed, 10 Dec 2008) Log Message: ----------- updated plot docstring Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-10 14:55:05 UTC (rev 6547) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-10 15:02:14 UTC (rev 6548) @@ -3171,46 +3171,55 @@ Return value is a list of lines that were added. - The following line styles are supported:: + The following format string characters are accepted to control + the line style or marker - - # solid line - -- # dashed line - -. # dash-dot line - : # dotted line - . # points - , # pixels - o # circle symbols - ^ # triangle up symbols - v # triangle down symbols - < # triangle left symbols - > # triangle right symbols - s # square symbols - + # plus symbols - * # star symbols - x # cross symbols - D # diamond symbols - d # thin diamond symbols - 1 # tripod down symbols - 2 # tripod up symbols - 3 # tripod left symbols - 4 # tripod right symbols - h # hexagon symbols - H # rotated hexagon symbols - p # pentagon symbols - | # vertical line symbols - _ # horizontal line symbols - steps # use gnuplot style 'steps' # kwarg only + ================ =============================== + character description + ================ =============================== + '-' solid line style + '--' dashed line style + '-.' dash-dot line style + ':' dotted line style + '.' point marker + ',' pixel marker + 'o' circle marker + 'v' triangle_down marker + '^' triangle_up marker + '<' triangle_left marker + '>' triangle_right marker + '1' tri_down marker + '2' tri_up marker + '3' tri_left marker + '4' tri_right marker + 's' square marker + 'p' pentagon marker + '*' star marker + 'h' hexagon1 marker + 'H' hexagon2 marker + '+' plus marker + 'x' x marker + 'D' diamond marker + 'd' thin_diamond marker + '|' vline marker + '_' hline marker + ================ =============================== + The following color abbreviations are supported:: - b # blue - g # green - r # red - c # cyan - m # magenta - y # yellow - k # black - w # white + ========== ======== + character color + ========== ======== + 'b' blue + 'g' green + 'r' red + 'c' cyan + 'm' magenta + 'y' yellow + 'k' black + 'w' white + ========== ======== In addition, you can specify colors in many weird and wonderful ways, including full names ('green'), hex @@ -3239,6 +3248,15 @@ Neither line will be antialiased. + You do not need to use format strings, which are just + abbreviations. All of the line properties can be controlled + by keyword arguments. For example, you can set the color, + marker, linestyle, and markercolor with:: + + plot(x, y, color='green', linestyle='dashed', marker='o', + markerfacecolor='blue', markersize=12). See + :class:~matplotlib.lines.Line2D for details. + The kwargs are :class:~matplotlib.lines.Line2D properties: %(Line2D)s This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6700] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-12-23 19:54 Revision: 6700 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6700&view=rev Author: jdh2358 Date: 2008-12-23 19:54:17 +0000 (Tue, 23 Dec 2008) Log Message: ----------- added support for mincnt to hexbin Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-23 19:49:08 UTC (rev 6699) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-23 19:54:17 UTC (rev 6700) @@ -5270,7 +5270,7 @@ Use a linear or log10 scale on the vertical axis. *mincnt*: None | a positive integer - If not None, only display cells with at least *mincnt* + If not None, only display cells with more than *mincnt* number of points in the cell Other keyword arguments controlling color mapping and normalization This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6701] trunk/matplotlib/lib/matplotlib/axes.py From: - 2008-12-23 23:17 Revision: 6701 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6701&view=rev Author: jdh2358 Date: 2008-12-23 21:55:45 +0000 (Tue, 23 Dec 2008) Log Message: ----------- fixed a mincnt problem with hexbin Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-23 19:54:17 UTC (rev 6700) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-23 21:55:45 UTC (rev 6701) @@ -5417,7 +5417,7 @@ for i in xrange(nx2): for j in xrange(ny2): vals = lattice2[i,j] - if len(vals): + if len(vals)>mincnt: lattice2[i,j] = reduce_C_function( vals ) else: lattice2[i,j] = np.nan This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6779] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-01-12 12:22 Revision: 6779 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6779&view=rev Author: jdh2358 Date: 2009-01-12 12:22:11 +0000 (Mon, 12 Jan 2009) Log Message: ----------- Added TJ's hexbin mincnt patch; made marginals False by default Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-01-12 09:04:57 UTC (rev 6778) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-01-12 12:22:11 UTC (rev 6779) @@ -5219,7 +5219,7 @@ xscale = 'linear', yscale = 'linear', cmap=None, norm=None, vmin=None, vmax=None, alpha=1.0, linewidths=None, edgecolors='none', - reduce_C_function = np.mean, mincnt=None, marginals=True, + reduce_C_function = np.mean, mincnt=None, marginals=False, **kwargs): """ call signature:: @@ -5395,9 +5395,6 @@ d1 = (x-ix1)**2 + 3.0 * (y-iy1)**2 d2 = (x-ix2-0.5)**2 + 3.0 * (y-iy2-0.5)**2 bdist = (d1

 SF.net SVN: matplotlib:[6784] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-01-15 19:41 Revision: 6784 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6784&view=rev Author: mdboom Date: 2009-01-15 19:41:52 +0000 (Thu, 15 Jan 2009) Log Message: ----------- [ 2502384 ] Typo in Documentation Linestyle strings are literal-quoted to prevent Sphinx from converting the characters within them. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-01-14 17:54:36 UTC (rev 6783) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-01-15 19:41:52 UTC (rev 6784) @@ -3216,32 +3216,32 @@ ================ =============================== character description ================ =============================== - '-' solid line style - '--' dashed line style - '-.' dash-dot line style - ':' dotted line style - '.' point marker - ',' pixel marker - 'o' circle marker - 'v' triangle_down marker - '^' triangle_up marker - '<' triangle_left marker - '>' triangle_right marker - '1' tri_down marker - '2' tri_up marker - '3' tri_left marker - '4' tri_right marker - 's' square marker - 'p' pentagon marker - '*' star marker - 'h' hexagon1 marker - 'H' hexagon2 marker - '+' plus marker - 'x' x marker - 'D' diamond marker - 'd' thin_diamond marker - '|' vline marker - '_' hline marker + '-' solid line style + '--' dashed line style + '-.' dash-dot line style + ':' dotted line style + '.' point marker + ',' pixel marker + 'o' circle marker + 'v' triangle_down marker + '^' triangle_up marker + '<' triangle_left marker + '>' triangle_right marker + '1' tri_down marker + '2' tri_up marker + '3' tri_left marker + '4' tri_right marker + 's' square marker + 'p' pentagon marker + '*' star marker + 'h' hexagon1 marker + 'H' hexagon2 marker + '+' plus marker + 'x' x marker + 'D' diamond marker + 'd' thin_diamond marker + '|' vline marker + '_' hline marker ================ =============================== @@ -5348,10 +5348,10 @@ self._process_unit_info(xdata=x, ydata=y, kwargs=kwargs) - + x, y, C = cbook.delete_masked_points(x, y, C) - + # Set the size of the hexagon grid if iterable(gridsize): nx, ny = gridsize @@ -5561,7 +5561,7 @@ else: thismax = thismin + np.diff(coarse)[-1] - if not valid[i]: continue + if not valid[i]: continue verts.append([(thismin, 0), (thismin, 0.05), (thismax, 0.05), (thismax, 0)]) values.append(val) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6853] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-01-29 21:01 Revision: 6853 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6853&view=rev Author: jrevans Date: 2009-01-29 21:01:45 +0000 (Thu, 29 Jan 2009) Log Message: ----------- Added ability to turn on/off the autoscale for the X & Y axes independantly. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-01-29 19:59:22 UTC (rev 6852) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-01-29 21:01:45 UTC (rev 6853) @@ -862,7 +862,8 @@ else: self.yaxis.set_scale('linear') - self._autoscaleon = True + self._autoscaleXon = True + self._autoscaleYon = True self._update_transScale() # needed? self._get_lines = _process_plot_var_args(self) @@ -1489,18 +1490,47 @@ def get_autoscale_on(self): """ - Get whether autoscaling is applied on plot commands + Get whether autoscaling is applied for both axes on plot commands """ - return self._autoscaleon + return self._autoscaleXon and self._autoscaleYon + def get_autoscalex_on(self): + """ + Get whether autoscaling for the x-axis is applied on plot commands + """ + return self._autoscaleXon + + def get_autoscaley_on(self): + """ + Get whether autoscaling for the y-axis is applied on plot commands + """ + return self._autoscaleYon + def set_autoscale_on(self, b): """ Set whether autoscaling is applied on plot commands accepts: [ *True* | *False* ] """ - self._autoscaleon = b + self._autoscaleXon = b + self._autoscaleYon = b + def set_autoscalex_on(self, b): + """ + Set whether autoscaling for the x-axis is applied on plot commands + + accepts: [ *True* | *False* ] + """ + self._autoscaleXon = b + + def set_autoscaley_on(self, b): + """ + Set whether autoscaling for the y-axis is applied on plot commands + + accepts: [ *True* | *False* ] + """ + self._autoscaleYon = b + def autoscale_view(self, tight=False, scalex=True, scaley=True): """ autoscale the view limits using the data limits. You can @@ -1509,13 +1539,12 @@ axis direction reversal that has already been done. """ # if image data only just use the datalim - if not self._autoscaleon: return - if scalex: + if scalex and self._autoscaleXon: xshared = self._shared_x_axes.get_siblings(self) dl = [ax.dataLim for ax in xshared] bb = mtransforms.BboxBase.union(dl) x0, x1 = bb.intervalx - if scaley: + if scaley and self._autoscaleYon: yshared = self._shared_y_axes.get_siblings(self) dl = [ax.dataLim for ax in yshared] bb = mtransforms.BboxBase.union(dl) @@ -1523,16 +1552,16 @@ if (tight or (len(self.images)>0 and len(self.lines)==0 and len(self.patches)==0)): - if scalex: + if scalex and self._autoscaleXon: self.set_xbound(x0, x1) - if scaley: + if scaley and self._autoscaleYon: self.set_ybound(y0, y1) return - if scalex: + if scalex and self._autoscaleXon: XL = self.xaxis.get_major_locator().view_limits(x0, x1) self.set_xbound(XL) - if scaley: + if scaley and self._autoscaleYon: YL = self.yaxis.get_major_locator().view_limits(y0, y1) self.set_ybound(YL) @@ -5953,8 +5982,9 @@ corners = (xmin, ymin), (xmax, ymax) self.update_datalim(corners) - if self._autoscaleon: + if self._autoscaleXon: self.set_xlim((xmin, xmax)) + if self._autoscaleYon: self.set_ylim((ymin, ymax)) self.images.append(im) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6895] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-02-09 18:49 Revision: 6895 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6895&view=rev Author: mdboom Date: 2009-02-09 18:49:49 +0000 (Mon, 09 Feb 2009) Log Message: ----------- Very minor indentation fix. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-02-09 18:23:56 UTC (rev 6894) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-02-09 18:49:49 UTC (rev 6895) @@ -140,7 +140,8 @@ self.colors = _process_plot_var_args.defaultColors[:] # if the default line color is a color format string, move it up # in the que - try: ind = self.colors.index(rcParams['lines.color']) + try: + ind = self.colors.index(rcParams['lines.color']) except ValueError: self.firstColor = rcParams['lines.color'] else: @@ -7415,7 +7416,7 @@ return the tight bounding box of the axes. The dimension of the Bbox in canvas coordinate. """ - + artists = [] bb = [] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6898] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-02-09 23:05 Revision: 6898 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6898&view=rev Author: jrevans Date: 2009-02-09 23:05:22 +0000 (Mon, 09 Feb 2009) Log Message: ----------- Fixed the bar plot code to use the proper unit conversion interface code. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-02-09 20:06:49 UTC (rev 6897) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-02-09 23:05:22 UTC (rev 6898) @@ -4094,18 +4094,12 @@ # lets do some conversions now since some types cannot be # subtracted uniformly if self.xaxis is not None: - xconv = self.xaxis.converter - if xconv is not None: - units = self.xaxis.get_units() - left = xconv.convert( left, units ) - width = xconv.convert( width, units ) + left = self.convert_xunits( left ) + width = self.convert_xunits( width ) if self.yaxis is not None: - yconv = self.yaxis.converter - if yconv is not None : - units = self.yaxis.get_units() - bottom = yconv.convert( bottom, units ) - height = yconv.convert( height, units ) + bottom = self.convert_yunits( bottom ) + height = self.convert_yunits( height ) if align == 'edge': pass This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6900] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-02-10 04:47 Revision: 6900 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6900&view=rev Author: astraw Date: 2009-02-10 04:47:29 +0000 (Tue, 10 Feb 2009) Log Message: ----------- doc bug: update axvline docstring Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-02-10 04:43:23 UTC (rev 6899) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-02-10 04:47:29 UTC (rev 6900) @@ -2880,8 +2880,8 @@ Draw a vertical line at *x* from *ymin* to *ymax*. With the default values of *ymin* = 0 and *ymax* = 1, this line will always span the vertical extent of the axes, regardless of the - xlim settings, even if you change them, eg. with the - :meth:set_xlim command. That is, the vertical extent is in + ylim settings, even if you change them, eg. with the + :meth:set_ylim command. That is, the vertical extent is in axes coords: 0=bottom, 0.5=middle, 1.0=top but the *x* location is in data coordinates. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6901] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-02-10 04:47 Revision: 6901 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6901&view=rev Author: astraw Date: 2009-02-10 04:47:43 +0000 (Tue, 10 Feb 2009) Log Message: ----------- axes.py: eliminate redundant attribute lookup Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-02-10 04:47:29 UTC (rev 6900) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-02-10 04:47:43 UTC (rev 6901) @@ -613,9 +613,9 @@ self.transData = self.transScale + (self.transLimits + self.transAxes) self._xaxis_transform = mtransforms.blended_transform_factory( - self.axes.transData, self.axes.transAxes) + self.transData, self.transAxes) self._yaxis_transform = mtransforms.blended_transform_factory( - self.axes.transAxes, self.axes.transData) + self.transAxes, self.transData) def get_xaxis_transform(self): """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6902] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-02-10 04:48 Revision: 6902 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6902&view=rev Author: astraw Date: 2009-02-10 04:47:57 +0000 (Tue, 10 Feb 2009) Log Message: ----------- axes.py: add comment describing separation of XY plots and polar plots Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-02-10 04:47:43 UTC (rev 6901) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-02-10 04:47:57 UTC (rev 6902) @@ -594,11 +594,20 @@ :class:~matplotlib.transforms.Bbox attributes and the *transScale*, *transData*, *transLimits* and *transAxes* transformations. + + .. note:: + This method is primarily used by rectilinear projections + of the :class:~matplotlib.axes.Axes class, and is meant + to be overridden by new kinds of projection axes that need + different transformations and limits. (See + :class:~matplotlib.projections.polar.PolarAxes for an + example. """ self.transAxes = mtransforms.BboxTransformTo(self.bbox) - # Transforms the x and y axis separately by a scale factor + # Transforms the x and y axis separately by a scale factor. # It is assumed that this part will have non-linear components + # (e.g. for a log scale). self.transScale = mtransforms.TransformWrapper( mtransforms.IdentityTransform()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[6945] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-02-28 20:13 Revision: 6945 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6945&view=rev Author: efiring Date: 2009-02-28 20:13:38 +0000 (Sat, 28 Feb 2009) Log Message: ----------- Better solution for twinx, twiny, thanks to Jae-Joon Lee Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-02-28 18:51:37 UTC (rev 6944) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-02-28 20:13:38 UTC (rev 6945) @@ -532,11 +532,6 @@ self._frameon = frameon self._axisbelow = rcParams['axes.axisbelow'] - # Attributes for controlling whether axis objects are drawn. - # They are helpers for twinx and twiny. - self._xaxison = True - self._yaxison = True - self._hold = rcParams['axes.hold'] self._connected = {} # a dict from events to (id, func) self.cla() @@ -1652,10 +1647,7 @@ else: self.xaxis.set_zorder(2.5) self.yaxis.set_zorder(2.5) - if self._xaxison: - artists.append(self.xaxis) - if self._yaxison: - artists.append(self.yaxis) + artists.extend([self.xaxis, self.yaxis]) if not inframe: artists.append(self.title) artists.extend(self.tables) if self.legend_ is not None: @@ -6610,7 +6602,7 @@ ax2.yaxis.tick_right() ax2.yaxis.set_label_position('right') self.yaxis.tick_left() - ax2._xaxison = False + ax2.xaxis.set_visible(False) return ax2 def twiny(self): @@ -6630,7 +6622,7 @@ ax2.xaxis.tick_top() ax2.xaxis.set_label_position('top') self.xaxis.tick_bottom() - ax2._yaxison = False + ax2.yaxis.set_visible(False) return ax2 def get_shared_x_axes(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[7067] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-04-27 23:30 Revision: 7067 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7067&view=rev Author: astraw Date: 2009-04-27 23:30:20 +0000 (Mon, 27 Apr 2009) Log Message: ----------- Don't raise error in boxplot() when a location has no observations. Fixes "IndexError: index out of range for array". Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-04-26 10:29:30 UTC (rev 7066) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-04-27 23:30:20 UTC (rev 7067) @@ -4856,6 +4856,9 @@ for i,pos in enumerate(positions): d = np.ravel(x[i]) row = len(d) + if row==0: + # no data, skip this position + continue # get median and quartiles q1, med, q3 = mlab.prctile(d,[25,50,75]) # get high extreme This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[7099] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-05-12 19:35 Revision: 7099 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7099&view=rev Author: leejjoon Date: 2009-05-12 19:35:25 +0000 (Tue, 12 May 2009) Log Message: ----------- fixed a few bugs introduced in r7098(aspect for log-log plot). Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-05-12 04:12:07 UTC (rev 7098) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-05-12 19:35:25 UTC (rev 7099) @@ -524,6 +524,8 @@ self.set_label(label) self.set_figure(fig) + self.set_axes_locator(kwargs.get("axes_locator", None)) + # this call may differ for non-sep axes, eg polar self._init_axis() @@ -548,7 +550,6 @@ self.set_navigate(True) self.set_navigate_mode(None) - self._axes_locator = None if xscale: self.set_xscale(xscale) @@ -1085,7 +1086,7 @@ raise ValueError('argument must be among %s' % ', '.join(mtransforms.BBox.coefs.keys())) - def get_data_ratio(self, mode="linear"): + def get_data_ratio(self): """ Returns the aspect ratio of the raw data. @@ -1095,16 +1096,26 @@ xmin,xmax = self.get_xbound() ymin,ymax = self.get_ybound() - if mode == "log": - xsize = max(math.fabs(math.log10(xmax)-math.log10(xmin)), 1e-30) - ysize = max(math.fabs(math.log10(ymax)-math.log10(ymin)), 1e-30) - else: - xsize = max(math.fabs(xmax-xmin), 1e-30) - ysize = max(math.fabs(ymax-ymin), 1e-30) + xsize = max(math.fabs(xmax-xmin), 1e-30) + ysize = max(math.fabs(ymax-ymin), 1e-30) return ysize/xsize + def get_data_ratio_log(self): + """ + Returns the aspect ratio of the raw data in log scale. + Will be used when both axis scales are in log. + """ + xmin,xmax = self.get_xbound() + ymin,ymax = self.get_ybound() + + xsize = max(math.fabs(math.log10(xmax)-math.log10(xmin)), 1e-30) + ysize = max(math.fabs(math.log10(ymax)-math.log10(ymin)), 1e-30) + + return ysize/xsize + + def apply_aspect(self, position=None): ''' Use :meth:_aspect and :meth:_adjustable to modify the @@ -1121,11 +1132,14 @@ aspect_scale_mode = "linear" elif xscale == "log" and yscale == "log": aspect_scale_mode = "log" - else: + elif (xscale == "linear" and yscale == "log") or \ + (xscale == "log" and yscale == "linear"): warnings.warn( 'aspect is not supported for Axes with xscale=%s, yscale=%s' \ % (xscale, yscale)) aspect = "auto" + else: # some custom projections have their own scales. + pass if aspect == 'auto': self.set_position( position , which='active') @@ -1147,7 +1161,10 @@ figW,figH = self.get_figure().get_size_inches() fig_aspect = figH/figW if self._adjustable == 'box': - box_aspect = A * self.get_data_ratio(mode=aspect_scale_mode) + if aspect_scale_mode == "log": + box_aspect = A * self.get_data_ratio_log() + else: + box_aspect = A * self.get_data_ratio() pb = position.frozen() pb1 = pb.shrunk_to_aspect(box_aspect, pb, fig_aspect) self.set_position(pb1.anchored(self.get_anchor(), pb), 'active') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[7105] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-05-16 12:47 Revision: 7105 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7105&view=rev Author: jdh2358 Date: 2009-05-16 12:47:27 +0000 (Sat, 16 May 2009) Log Message: ----------- fixed plot_date docstring Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-05-16 02:22:57 UTC (rev 7104) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-05-16 12:47:27 UTC (rev 7105) @@ -3512,13 +3512,13 @@ may be necessary to set the formatters/locators after the call to :meth:plot_date since :meth:plot_date will set the default tick locator to - :class:matplotlib.ticker.AutoDateLocator (if the tick + :class:matplotlib.dates.AutoDateLocator (if the tick locator is not already set to a - :class:matplotlib.ticker.DateLocator instance) and the + :class:matplotlib.dates.DateLocator instance) and the default tick formatter to - :class:matplotlib.ticker.AutoDateFormatter (if the tick + :class:matplotlib.dates.AutoDateFormatter (if the tick formatter is not already set to a - :class:matplotlib.ticker.DateFormatter instance). + :class:matplotlib.dates.DateFormatter instance). Valid kwargs are :class:~matplotlib.lines.Line2D properties: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[7114] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-05-17 21:36 Revision: 7114 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7114&view=rev Author: leejjoon Date: 2009-05-17 21:36:34 +0000 (Sun, 17 May 2009) Log Message: ----------- a warning won't be issued for semilog axes if aspect="auto" Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-05-17 18:00:10 UTC (rev 7113) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-05-17 21:36:34 UTC (rev 7114) @@ -1137,10 +1137,11 @@ aspect_scale_mode = "log" elif (xscale == "linear" and yscale == "log") or \ (xscale == "log" and yscale == "linear"): - warnings.warn( - 'aspect is not supported for Axes with xscale=%s, yscale=%s' \ - % (xscale, yscale)) - aspect = "auto" + if aspect is not "auto": + warnings.warn( + 'aspect is not supported for Axes with xscale=%s, yscale=%s' \ + % (xscale, yscale)) + aspect = "auto" else: # some custom projections have their own scales. pass This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[7134] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-05-22 17:36 Revision: 7134 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7134&view=rev Author: efiring Date: 2009-05-22 17:36:28 +0000 (Fri, 22 May 2009) Log Message: ----------- Make polar_bar work with new Path._interpolation_steps attribute Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-05-22 14:24:55 UTC (rev 7133) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-05-22 17:36:28 UTC (rev 7134) @@ -4309,6 +4309,7 @@ ) label = '_nolegend_' r.update(kwargs) + r.get_path()._interpolation_steps = 100 #print r.get_label(), label, 'label' in kwargs self.add_patch(r) patches.append(r) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[7194] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-06-07 14:13 Revision: 7194 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7194&view=rev Author: jdh2358 Date: 2009-06-07 14:13:12 +0000 (Sun, 07 Jun 2009) Log Message: ----------- update doc strings to point to new fill between demos Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-06-07 13:58:48 UTC (rev 7193) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-06-07 14:13:12 UTC (rev 7194) @@ -6019,7 +6019,7 @@ %(PolyCollection)s - .. plot:: mpl_examples/pylab_examples/fill_between.py + .. plot:: mpl_examples/pylab_examples/fill_between_demo.py.py .. seealso:: @@ -6126,7 +6126,7 @@ %(PolyCollection)s - .. plot:: mpl_examples/pylab_examples/fill_betweenx.py + .. plot:: mpl_examples/pylab_examples/fill_betweenx_demo.py .. seealso:: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[7219] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-06-14 17:24 Revision: 7219 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7219&view=rev Author: jdh2358 Date: 2009-06-14 17:24:45 +0000 (Sun, 14 Jun 2009) Log Message: ----------- added variant of sf patch 2805653 for specgram kwargs pass thru to imshow Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-06-14 05:38:11 UTC (rev 7218) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-06-14 17:24:45 UTC (rev 7219) @@ -7530,14 +7530,14 @@ def specgram(self, x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, window=mlab.window_hanning, noverlap=128, cmap=None, xextent=None, pad_to=None, sides='default', - scale_by_freq=None): + scale_by_freq=None, **kwargs): """ call signature:: specgram(x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, window=mlab.window_hanning, noverlap=128, cmap=None, xextent=None, pad_to=None, sides='default', - scale_by_freq=None) + scale_by_freq=None, **kwargs) Compute a spectrogram of data in *x*. Data are split into *NFFT* length segments and the PSD of each section is @@ -7562,8 +7562,13 @@ The default is (0,max(bins)), where bins is the return value from :func:mlab.specgram - Return value is (*Pxx*, *freqs*, *bins*, *im*): + *kwargs*: + Additional kwargs are passed on to imshow which makes the + specgram image + + Return value is (*Pxx*, *freqs*, *bins*, *im*): + - *bins* are the time points the spectrogram is calculated over - *freqs* is an array of frequencies - *Pxx* is a len(times) x len(freqs) array of power @@ -7590,7 +7595,7 @@ xmin, xmax = xextent freqs += Fc extent = xmin, xmax, freqs[0], freqs[-1] - im = self.imshow(Z, cmap, extent=extent) + im = self.imshow(Z, cmap, extent=extent, **kwargs) self.axis('auto') return Pxx, freqs, bins, im This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[7220] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-06-14 17:34 Revision: 7220 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7220&view=rev Author: jdh2358 Date: 2009-06-14 17:34:40 +0000 (Sun, 14 Jun 2009) Log Message: ----------- fixed errorbar Nx2 docstring bug as described in sf bug 2804502 Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-06-14 17:24:45 UTC (rev 7219) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-06-14 17:34:40 UTC (rev 7220) @@ -4725,12 +4725,12 @@ Optional keyword arguments: - *xerr*/*yerr*: [ scalar | N, Nx1, Nx2 array-like ] + *xerr*/*yerr*: [ scalar | N, Nx1, or 2xN array-like ] If a scalar number, len(N) array-like object, or an Nx1 array-like object, errorbars are drawn +/- value. - If a rank-1, Nx2 Numpy array, errorbars are drawn at -column1 and - +column2 + If a rank-1, 2xN numpy array, errorbars are drawn at -row1 and + +row2 *fmt*: '-' The plot format symbol for *y*. If *fmt* is *None*, just plot the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[7824] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-09-24 20:47 Revision: 7824 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7824&view=rev Author: jrevans Date: 2009-09-24 20:47:11 +0000 (Thu, 24 Sep 2009) Log Message: ----------- Fixed a comparison in update_patch_limits that compared data with being equall to zero. This will fail with unitized data. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-09-24 17:05:51 UTC (rev 7823) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-09-24 20:47:11 UTC (rev 7824) @@ -1444,8 +1444,9 @@ # scaling. We'll ignore rects with zero height or width in # the auto-scaling + # cannot check for '==0' since unitized data may not compare to zero if (isinstance(patch, mpatches.Rectangle) and - (patch.get_width()==0 or patch.get_height()==0)): + ((not patch.get_width()) or (notpatch.get_height()))): return vertices = patch.get_path().vertices if vertices.size > 0: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[7825] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-09-24 21:16 Revision: 7825 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7825&view=rev Author: jrevans Date: 2009-09-24 21:16:07 +0000 (Thu, 24 Sep 2009) Log Message: ----------- Fixed a typo. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-09-24 20:47:11 UTC (rev 7824) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-09-24 21:16:07 UTC (rev 7825) @@ -1446,7 +1446,7 @@ # cannot check for '==0' since unitized data may not compare to zero if (isinstance(patch, mpatches.Rectangle) and - ((not patch.get_width()) or (notpatch.get_height()))): + ((not patch.get_width()) or (not patch.get_height()))): return vertices = patch.get_path().vertices if vertices.size > 0: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[7951] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-11-11 23:59 Revision: 7951 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7951&view=rev Author: leejjoon Date: 2009-11-11 23:59:23 +0000 (Wed, 11 Nov 2009) Log Message: ----------- drawing images respect zorder among images even for noncomposite backend Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-11-10 21:03:51 UTC (rev 7950) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-11-11 23:59:23 UTC (rev 7951) @@ -1727,9 +1727,12 @@ # make a composite image blending alpha # list of (mimage.Image, ox, oy) + zorder_images = [(im.zorder, im) for im in self.images \ + if im.get_visible()] + zorder_images.sort() + mag = renderer.get_image_magnification() - ims = [(im.make_image(mag),0,0) - for im in self.images if im.get_visible()] + ims = [(im.make_image(mag),0,0) for z,im in zorder_images] l, b, r, t = self.bbox.extents This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[7958] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-11-12 22:48 Revision: 7958 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7958&view=rev Author: astraw Date: 2009-11-12 22:47:43 +0000 (Thu, 12 Nov 2009) Log Message: ----------- axes.py: remove redundant variable Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-11-12 22:17:24 UTC (rev 7957) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-11-12 22:47:43 UTC (rev 7958) @@ -1698,7 +1698,7 @@ artists.extend(self.spines.itervalues()) - dsu = [ (a.zorder, i, a) for i, a in enumerate(artists) + dsu = [ (a.zorder, a) for a in artists if not a.get_animated() ] dsu.sort() @@ -1721,7 +1721,7 @@ if len(self.images)<=1 or renderer.option_image_nocomposite(): for im in self.images: - dsu.append( (im.zorder, len(dsu), im) ) + dsu.append( (im.zorder, im) ) dsu.sort() # re-sort with images now else: # make a composite image blending alpha @@ -1757,11 +1757,11 @@ gc.restore() if dsu_rasterized: - for zorder, i, a in dsu_rasterized: + for zorder, a in dsu_rasterized: a.draw(renderer) renderer.stop_rasterizing() - for zorder, i, a in dsu: + for zorder, a in dsu: a.draw(renderer) renderer.close_group('axes') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8022] trunk/matplotlib/lib/matplotlib/axes.py From: - 2009-12-11 16:57 Revision: 8022 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8022&view=rev Author: leejjoon Date: 2009-12-11 16:57:46 +0000 (Fri, 11 Dec 2009) Log Message: ----------- Axes.draw rearranged to support rasterization Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-12-11 00:59:34 UTC (rev 8021) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-12-11 16:57:46 UTC (rev 8022) @@ -30,6 +30,8 @@ import matplotlib.ticker as mticker import matplotlib.transforms as mtransforms +from operator import itemgetter + iterable = cbook.iterable is_string_like = cbook.is_string_like is_sequence_of_strings = cbook.is_sequence_of_strings @@ -1698,11 +1700,22 @@ artists.extend(self.spines.itervalues()) + dsu = [ (a.zorder, a) for a in artists if not a.get_animated() ] - dsu.sort(key=lambda x: x[0]) + # add images to dsu if the backend support compositing. + # otherwise, does the manaul compositing without adding images to dsu. + if len(self.images)<=1 or renderer.option_image_nocomposite(): + dsu.extend([(im.zorder, im) for im in self.images]) + _do_composite = False + else: + _do_composite = True + + + dsu.sort(key=itemgetter(0)) + # rasterize artists with negative zorder # if the minimum zorder is negative, start rasterization rasterization_zorder = self._rasterization_zorder @@ -1719,11 +1732,7 @@ if self.axison and self._frameon: self.patch.draw(renderer) - if len(self.images)<=1 or renderer.option_image_nocomposite(): - for im in self.images: - dsu.append( (im.zorder, im) ) - dsu.sort(key=lambda x: x[0]) # re-sort with images now - else: + if _do_composite: # make a composite image blending alpha # list of (mimage.Image, ox, oy) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8067] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-01-04 04:30 Revision: 8067 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8067&view=rev Author: efiring Date: 2010-01-04 04:30:24 +0000 (Mon, 04 Jan 2010) Log Message: ----------- Remove unnecessary private method. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-01-04 02:22:26 UTC (rev 8066) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-01-04 04:30:24 UTC (rev 8067) @@ -150,11 +150,8 @@ def set_color_cycle(self, clist=None): if clist is None: clist = rcParams['axes.color_cycle'] - self._colors = itertools.cycle(clist) + self.color_cycle = itertools.cycle(clist) - def _get_next_cycle_color(self): - return self._colors.next() - def __call__(self, *args, **kwargs): if self.axes.xaxis is not None and self.axes.yaxis is not None: @@ -225,7 +222,7 @@ def _makeline(self, x, y, kw, kwargs): kw = kw.copy() # Don't modify the original kw. if not 'color' in kw: - kw['color'] = self._get_next_cycle_color() + kw['color'] = self.color_cycle.next() # (can't use setdefault because it always evaluates # its second argument) seg = mlines.Line2D(x, y, @@ -239,7 +236,7 @@ try: facecolor = kw['color'] except KeyError: - facecolor = self._get_next_cycle_color() + facecolor = self.color_cycle.next() seg = mpatches.Polygon(np.hstack( (x[:,np.newaxis],y[:,np.newaxis])), facecolor = facecolor, @@ -4866,7 +4863,7 @@ if ecolor is None: if l0 is None: - ecolor = self._get_lines._get_next_cycle_color() + ecolor = self._get_lines.color_cycle.next() else: ecolor = l0.get_color() @@ -7163,7 +7160,7 @@ if orientation == 'horizontal': for m in n: - color = self._get_lines._get_next_cycle_color() + color = self._get_lines.color_cycle.next() patch = self.barh(bins[:-1]+boffset, m, height=width, left=bottom, align='center', log=log, color=color) @@ -7174,7 +7171,7 @@ boffset += dw elif orientation == 'vertical': for m in n: - color = self._get_lines._get_next_cycle_color() + color = self._get_lines.color_cycle.next() patch = self.bar(bins[:-1]+boffset, m, width=width, bottom=bottom, align='center', log=log, color=color) @@ -7219,7 +7216,7 @@ elif orientation != 'vertical': raise ValueError, 'invalid orientation: %s' % orientation - color = self._get_lines._get_next_cycle_color() + color = self._get_lines.color_cycle.next() if fill: patches.append( self.fill(x, y, closed=False, facecolor=color) ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8218] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-04-02 21:29 Revision: 8218 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8218&view=rev Author: efiring Date: 2010-04-02 21:29:38 +0000 (Fri, 02 Apr 2010) Log Message: ----------- Axes.hist: style changes, bug fixes Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-04-02 18:47:00 UTC (rev 8217) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-04-02 21:29:38 UTC (rev 8218) @@ -5311,7 +5311,7 @@ s = np.ma.ravel(s) # This doesn't have to match x, y in size. - c_is_stringy = is_string_like(c) or cbook.is_sequence_of_strings(c) + c_is_stringy = is_string_like(c) or is_sequence_of_strings(c) if not c_is_stringy: c = np.asanyarray(c) if c.size == x.size: @@ -6989,6 +6989,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None, cumulative=False, bottom=None, histtype='bar', align='mid', orientation='vertical', rwidth=None, log=False, + color=None, **kwargs): """ call signature:: @@ -7002,16 +7003,21 @@ [*patches0*, *patches1*,...]) if the input contains multiple data. + Multiple data can be provided via *x* as a list of datasets + of potentially different length ([*x0*, *x1*, ...]), or as + a 2-D ndarray in which each column is a dataset. Note that + the ndarray form is transposed relative to the list form. + + Masked arrays are not supported at present. + Keyword arguments: *bins*: Either an integer number of bins or a sequence giving the - bins. *x* are the data to be binned. *x* can be an array, - a 2D array with multiple data in its columns, or a list of - arrays with data of different length. Note, if *bins* - is an integer input argument=numbins, *bins* + 1 bin edges - will be returned, compatible with the semantics of - :func:numpy.histogram with the *new* = True argument. + bins. If *bins* is an integer, *bins* + 1 bin edges + will be returned, consistent with :func:numpy.histogram + for numpy version >= 1.3, and with the *new* = True argument + in earlier versions. Unequally spaced bins are supported if *bins* is a sequence. *range*: @@ -7090,6 +7096,9 @@ be filtered out and only the non-empty (*n*, *bins*, *patches*) will be returned. + *color*: + + kwargs are used to update the properties of the hist :class:~matplotlib.patches.Rectangle instances: @@ -7117,65 +7126,74 @@ # NOTE: the range keyword overwrites the built-in func range !!! # needs to be fixed in numpy !!! + # Validate string inputs here so we don't have to clutter + # subsequent code. + if histtype not in ['bar', 'barstacked', 'step', 'stepfilled']: + raise ValueError("histtype %s is not recognized" % histtype) + + if align not in ['left', 'mid', 'right']: + raise ValueError("align kwarg %s is not recognized" % align) + + if orientation not in [ 'horizontal', 'vertical']: + raise ValueError( + "orientation kwarg %s is not recognized" % orientation) + + if kwargs.get('width') is not None: raise DeprecationWarning( 'hist now uses the rwidth to give relative width ' 'and not absolute width') - try: - # make sure a copy is created: don't use asarray - x = np.transpose(np.array(x)) - if len(x.shape)==1: - x.shape = (1,x.shape[0]) - elif len(x.shape)==2 and x.shape[1]1: dr = 0.8 - else: dr = 1.0 + if rwidth is not None: + dr = min(1.0, max(0.0, rwidth)) + elif len(n)>1: + dr = 0.8 + else: + dr = 1.0 if histtype=='bar': - width = dr*totwidth/len(n) + width = dr*totwidth/nx dw = width - if len(n)>1: - boffset = -0.5*dr*totwidth*(1.-1./len(n)) + if nx > 1: + boffset = -0.5*dr*totwidth*(1.0-1.0/nx) else: boffset = 0.0 + stacked = False elif histtype=='barstacked': width = dr*totwidth boffset, dw = 0.0, 0.0 - stacked = True - else: - raise ValueError, 'invalid histtype: %s' % histtype if align == 'mid' or align == 'edge': boffset += 0.5*totwidth elif align == 'right': boffset += totwidth - elif align != 'left' and align != 'center': - raise ValueError, 'invalid align: %s' % align if orientation == 'horizontal': - for m in n: - color = self._get_lines.color_cycle.next() - patch = self.barh(bins[:-1]+boffset, m, height=width, - left=bottom, align='center', log=log, - color=color) - patches.append(patch) - if stacked: - if bottom is None: bottom = 0.0 - bottom += m - boffset += dw - elif orientation == 'vertical': - for m in n: - color = self._get_lines.color_cycle.next() - patch = self.bar(bins[:-1]+boffset, m, width=width, - bottom=bottom, align='center', log=log, - color=color) - patches.append(patch) - if stacked: - if bottom is None: bottom = 0.0 - bottom += m - boffset += dw - else: - raise ValueError, 'invalid orientation: %s' % orientation + _barfunc = self.barh + else: # orientation == 'vertical' + _barfunc = self.bar + for m in n: + color = self._get_lines.color_cycle.next() + patch = _barfunc(bins[:-1]+boffset, m, width, bottom, + align='center', log=log, + color=color) + patches.append(patch) + if stacked: + if bottom is None: + bottom = 0.0 + bottom += m + boffset += dw + elif histtype.startswith('step'): x = np.zeros( 2*len(bins), np.float ) y = np.zeros( 2*len(bins), np.float ) @@ -7259,21 +7267,15 @@ x -= 0.5*(bins[1]-bins[0]) elif align == 'right': x += 0.5*(bins[1]-bins[0]) - elif align != 'mid' and align != 'edge': - raise ValueError, 'invalid align: %s' % align if log: y[0],y[-1] = 1e-100, 1e-100 if orientation == 'horizontal': self.set_xscale('log') - elif orientation == 'vertical': + else: # orientation == 'vertical' self.set_yscale('log') - fill = False - if histtype == 'stepfilled': - fill = True - elif histtype != 'step': - raise ValueError, 'invalid histtype: %s' % histtype + fill = (histtype == 'stepfilled') for m in n: y[1:-1:2], y[2::2] = m, m @@ -7281,8 +7283,6 @@ y[y<1e-100]=1e-100 if orientation == 'horizontal': x,y = y,x - elif orientation != 'vertical': - raise ValueError, 'invalid orientation: %s' % orientation color = self._get_lines.color_cycle.next() if fill: @@ -7307,17 +7307,17 @@ self.dataLim.intervaly = (ymin, ymax) self.autoscale_view() - else: - raise ValueError, 'invalid histtype: %s' % histtype + label = kwargs.pop('label', '_nolegend_') - label = kwargs.pop('label', '') - if is_string_like(label): - labels = [label] + ['_nolegend_']*(len(patches)-1) - elif is_sequence_of_strings: - labels = list(label) + ['_nolegend_']*(len(patches)-1) + labels = [label] + elif is_sequence_of_strings(label): + labels = list(label) else: - raise ValueError, 'invalid label: must be string or sequence of strings' + raise ValueError( + 'invalid label: must be string or sequence of strings') + if len(labels) < nx: + labels += ['_nolegend_'] * (nx - len(labels)) for (patch, lbl) in zip(patches, labels): for p in patch: @@ -7329,14 +7329,16 @@ self.set_autoscale_on(False) if orientation == 'vertical': self.autoscale_view(scalex=False, scaley=True) - XL = self.xaxis.get_major_locator().view_limits(bins[0], bins[-1]) + XL = self.xaxis.get_major_locator().view_limits( + bins[0], bins[-1]) self.set_xbound(XL) else: self.autoscale_view(scalex=True, scaley=False) - YL = self.yaxis.get_major_locator().view_limits(bins[0], bins[-1]) + YL = self.yaxis.get_major_locator().view_limits( + bins[0], bins[-1]) self.set_ybound(YL) - if len(n)==1: + if nx == 1: return n[0], bins, cbook.silent_list('Patch', patches[0]) else: return n, bins, cbook.silent_list('Lists of Patches', patches) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8219] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-04-03 07:18 Revision: 8219 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8219&view=rev Author: efiring Date: 2010-04-03 07:18:18 +0000 (Sat, 03 Apr 2010) Log Message: ----------- Axes.hist: add color kwarg. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-04-02 21:29:38 UTC (rev 8218) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-04-03 07:18:18 UTC (rev 8219) @@ -7097,8 +7097,10 @@ *patches*) will be returned. *color*: + Color spec or sequence of color specs, one per + dataset. Default (*None*) uses the standard line + color sequence. - kwargs are used to update the properties of the hist :class:~matplotlib.patches.Rectangle instances: @@ -7163,6 +7165,14 @@ nx = len(x) # number of datasets + if color is None: + color = [self._get_lines.color_cycle.next() + for i in xrange(nx)] + else: + color = mcolors.colorConverter.to_rgba_array(color) + if len(color) != nx: + raise ValueError("color kwarg must have one color per dataset") + if weights is not None: if isinstance(w, np.ndarray): w = np.array(weights) @@ -7245,11 +7255,10 @@ else: # orientation == 'vertical' _barfunc = self.bar - for m in n: - color = self._get_lines.color_cycle.next() + for m, c in zip(n, color): patch = _barfunc(bins[:-1]+boffset, m, width, bottom, align='center', log=log, - color=color) + color=c) patches.append(patch) if stacked: if bottom is None: @@ -7277,20 +7286,19 @@ fill = (histtype == 'stepfilled') - for m in n: + for m, c in zip(n, color): y[1:-1:2], y[2::2] = m, m if log: y[y<1e-100]=1e-100 if orientation == 'horizontal': x,y = y,x - color = self._get_lines.color_cycle.next() if fill: patches.append( self.fill(x, y, - closed=False, facecolor=color) ) + closed=False, facecolor=c) ) else: patches.append( self.fill(x, y, - closed=False, edgecolor=color, fill=False) ) + closed=False, edgecolor=c, fill=False) ) # adopted from adjust_x/ylim part of the bar method if orientation == 'horizontal': This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8221] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-04-05 01:07 Revision: 8221 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8221&view=rev Author: efiring Date: 2010-04-05 01:06:57 +0000 (Mon, 05 Apr 2010) Log Message: ----------- Axes.hist: make 'label' an explicit kwarg, like 'color' Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-04-03 23:22:48 UTC (rev 8220) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-04-05 01:06:57 UTC (rev 8221) @@ -6989,7 +6989,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None, cumulative=False, bottom=None, histtype='bar', align='mid', orientation='vertical', rwidth=None, log=False, - color=None, + color=None, label=None, **kwargs): """ call signature:: @@ -7101,24 +7101,21 @@ dataset. Default (*None*) uses the standard line color sequence. - kwargs are used to update the properties of the hist - :class:~matplotlib.patches.Rectangle instances: + *label*: + String, or sequence of strings to match multiple + datasets. Bar charts yield multiple patches per + dataset, but only the first gets the label, so + that the legend command will work as expected:: - %(Rectangle)s + ax.hist(10+2*np.random.randn(1000), label='men') + ax.hist(12+3*np.random.randn(1000), label='women', alpha=0.5) + ax.legend() - You can use labels for your histogram, and only the first - :class:~matplotlib.patches.Rectangle gets the label (the - others get the magic string '_nolegend_'. This will make the - histograms work in the intuitive way for bar charts:: + kwargs are used to update the properties of the + :class:~matplotlib.patches.Patch instances returned by *hist*: - ax.hist(10+2*np.random.randn(1000), label='men') - ax.hist(12+3*np.random.randn(1000), label='women', alpha=0.5) - ax.legend() + %(Patch)s - label can also be a sequence of strings. If multiple data is - provided in *x*, the labels are asigned sequentially to the - histograms. - **Example:** .. plot:: mpl_examples/pylab_examples/histogram_demo.py @@ -7315,9 +7312,9 @@ self.dataLim.intervaly = (ymin, ymax) self.autoscale_view() - label = kwargs.pop('label', '_nolegend_') - - if is_string_like(label): + if label is None: + labels = ['_nolegend_'] + elif is_string_like(label): labels = [label] elif is_sequence_of_strings(label): labels = list(label) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8264] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-04-22 03:23 Revision: 8264 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8264&view=rev Author: efiring Date: 2010-04-22 03:22:55 +0000 (Thu, 22 Apr 2010) Log Message: ----------- Axes: save "tight" state; margin() default is now tight=True Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-04-21 21:49:53 UTC (rev 8263) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-04-22 03:22:55 UTC (rev 8264) @@ -838,6 +838,7 @@ self._autoscaleYon = True self._xmargin = 0 self._ymargin = 0 + self._tight = True self._update_transScale() # needed? self._get_lines = _process_plot_var_args(self) @@ -1231,7 +1232,7 @@ elif s in ('equal', 'tight', 'scaled', 'normal', 'auto', 'image'): self.set_autoscale_on(True) self.set_aspect('auto') - self.autoscale_view() + self.autoscale_view(tight=False) # self.apply_aspect() if s=='equal': self.set_aspect('equal', adjustable='datalim') @@ -1646,17 +1647,22 @@ :: - margins(margin, tight=True) + margins(margin) - margins(xmargin, ymargin, tight=True) + margins(xmargin, ymargin) - margins(x=xmargin, y=ymargin, tight=True) + margins(x=xmargin, y=ymargin) + margins(..., tight=False) + All three forms above set the xmargin and ymargin parameters. All keyword parameters are optional. A single argument specifies both xmargin and ymargin. The *tight* parameter is passed to :meth:autoscale_view, which is executed after - a margin is changed. + a margin is changed; the default here is *True*, on the + assumption that when margins are specified, no additional + padding to match tick marks is usually desired. Setting + *tight* to *None* will preserve the previous setting. Specifying any margin changes only the autoscaling; for example, if *xmargin* is not zero, then *xmargin* times the X data @@ -1667,7 +1673,7 @@ if not args and not kw: return self._ymargin, self._ymargin - tight = kw.pop('tight', False) + tight = kw.pop('tight', True) mx = kw.pop('x', None) my = kw.pop('y', None) if len(args) == 1: @@ -1697,7 +1703,7 @@ return self._rasterization_zorder - def autoscale_view(self, tight=False, scalex=True, scaley=True): + def autoscale_view(self, tight=None, scalex=True, scaley=True): """ autoscale the view limits using the data limits. You can selectively autoscale only a single axis, eg, the xaxis by @@ -1725,7 +1731,9 @@ y0 -= delta y1 += delta - if (tight or (len(self.images)>0 and + if tight is not None: + self._tight = bool(tight) + if (self._tight or (len(self.images)>0 and len(self.lines)==0 and len(self.patches)==0)): if scalex and self._autoscaleXon: @@ -2027,7 +2035,7 @@ raise AttributeError( "This method only works with the ScalarFormatter.") - def locator_params(self, axis='both', tight=False, **kwargs): + def locator_params(self, axis='both', tight=None, **kwargs): """ Convenience method for controlling tick locators. @@ -2038,7 +2046,8 @@ default is 'both'. *tight* - [True | False] Parameter passed to :meth:autoscale_view. + [True | False | None] Parameter passed to :meth:autoscale_view. + Default is None, for no change. Remaining keyword arguments are passed to directly to the :meth:~matplotlib.ticker.MaxNLocator.set_params method. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8266] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-04-22 07:49 Revision: 8266 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8266&view=rev Author: efiring Date: 2010-04-22 07:49:13 +0000 (Thu, 22 Apr 2010) Log Message: ----------- Axes.autoscale_view: ensure finite ranges; rearrange code for readability Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-04-22 03:34:10 UTC (rev 8265) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-04-22 07:49:13 UTC (rev 8266) @@ -1710,45 +1710,41 @@ setting *scaley* to *False*. The autoscaling preserves any axis direction reversal that has already been done. """ + if tight is not None: + self._tight = bool(tight) # if image data only just use the datalim + _tight = self._tight or (len(self.images)>0 and + len(self.lines)==0 and + len(self.patches)==0) + if scalex and self._autoscaleXon: xshared = self._shared_x_axes.get_siblings(self) dl = [ax.dataLim for ax in xshared] bb = mtransforms.BboxBase.union(dl) x0, x1 = bb.intervalx + x0, x1 = mtransforms.nonsingular(x0, x1, increasing=False) if self._xmargin > 0: delta = (x1 - x0) * self._xmargin x0 -= delta x1 += delta + if not _tight: + x0, x1 = self.xaxis.get_major_locator().view_limits(x0, x1) + self.set_xbound(x0, x1) if scaley and self._autoscaleYon: yshared = self._shared_y_axes.get_siblings(self) dl = [ax.dataLim for ax in yshared] bb = mtransforms.BboxBase.union(dl) y0, y1 = bb.intervaly + y0, y1 = mtransforms.nonsingular(y0, y1, increasing=False) if self._ymargin > 0: delta = (y1 - y0) * self._ymargin y0 -= delta y1 += delta + if not _tight: + y0, y1 = self.yaxis.get_major_locator().view_limits(y0, y1) + self.set_ybound(y0, y1) - if tight is not None: - self._tight = bool(tight) - if (self._tight or (len(self.images)>0 and - len(self.lines)==0 and - len(self.patches)==0)): - if scalex and self._autoscaleXon: - self.set_xbound(x0, x1) - if scaley and self._autoscaleYon: - self.set_ybound(y0, y1) - return - - if scalex and self._autoscaleXon: - XL = self.xaxis.get_major_locator().view_limits(x0, x1) - self.set_xbound(XL) - if scaley and self._autoscaleYon: - YL = self.yaxis.get_major_locator().view_limits(y0, y1) - self.set_ybound(YL) - #### Drawing @allow_rasterization This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8267] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-04-22 08:27 Revision: 8267 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8267&view=rev Author: efiring Date: 2010-04-22 08:27:18 +0000 (Thu, 22 Apr 2010) Log Message: ----------- Axes.hist: remove unnecessary copying of input array. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-04-22 07:49:13 UTC (rev 8266) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-04-22 08:27:18 UTC (rev 8267) @@ -7289,17 +7289,16 @@ if isinstance(x, np.ndarray): # TODO: support masked arrays; - # Why is the copy needed? - x = np.array(x, copy=True, subok=False) + x = np.asarray(x) if x.ndim == 2: - x = x.T + x = x.T # 2-D input with columns as datasets; switch to rows elif x.ndim == 1: - x.shape = (1, x.shape[0]) + x = x.reshape(1, x.shape[0]) # new view, single row else: raise ValueError("x must be 1D or 2D") if x.shape[1] < x.shape[0]: - warnings.warn('2D hist input should be nsamples x nvariables; ' - 'this looks transposed') + warnings.warn('2D hist input should be nsamples x nvariables;\n ' + 'this looks transposed (shape is %d x %d)' % x.shape[::-1]) else: # multiple hist with data of different length x = [np.array(xi) for xi in x] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8268] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-04-23 18:33 Revision: 8268 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8268&view=rev Author: mdboom Date: 2010-04-23 18:33:51 +0000 (Fri, 23 Apr 2010) Log Message: ----------- Fix docstring formatting in imshow. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-04-22 08:27:18 UTC (rev 8267) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-04-23 18:33:51 UTC (rev 8268) @@ -6406,11 +6406,10 @@ *interpolation*: Acceptable values are *None*, 'nearest', 'bilinear', - 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', - 'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian', - 'bessel', 'mitchell', 'sinc', 'lanczos', + 'bicubic', 'spline16', 'spline36', 'hanning', 'hamming', + 'hermite', 'kaiser', 'quadric', 'catrom', 'gaussian', + 'bessel', 'mitchell', 'sinc', 'lanczos' - If *interpolation* is *None*, default to rc image.interpolation. See also the *filternorm* and *filterrad* parameters This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8274] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-04-26 21:11 Revision: 8274 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8274&view=rev Author: efiring Date: 2010-04-26 21:11:03 +0000 (Mon, 26 Apr 2010) Log Message: ----------- axes: set _tight default to False; restore previous nonsingular expander Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-04-26 20:37:14 UTC (rev 8273) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-04-26 21:11:03 UTC (rev 8274) @@ -838,7 +838,7 @@ self._autoscaleYon = True self._xmargin = 0 self._ymargin = 0 - self._tight = True + self._tight = False self._update_transScale() # needed? self._get_lines = _process_plot_var_args(self) @@ -1722,7 +1722,8 @@ dl = [ax.dataLim for ax in xshared] bb = mtransforms.BboxBase.union(dl) x0, x1 = bb.intervalx - x0, x1 = mtransforms.nonsingular(x0, x1, increasing=False) + x0, x1 = mtransforms.nonsingular(x0, x1, increasing=False, + expander=0.05) if self._xmargin > 0: delta = (x1 - x0) * self._xmargin x0 -= delta @@ -1736,7 +1737,8 @@ dl = [ax.dataLim for ax in yshared] bb = mtransforms.BboxBase.union(dl) y0, y1 = bb.intervaly - y0, y1 = mtransforms.nonsingular(y0, y1, increasing=False) + y0, y1 = mtransforms.nonsingular(y0, y1, increasing=False, + expander=0.05) if self._ymargin > 0: delta = (y1 - y0) * self._ymargin y0 -= delta This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8293] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-05-04 05:24 Revision: 8293 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8293&view=rev Author: efiring Date: 2010-05-04 05:24:53 +0000 (Tue, 04 May 2010) Log Message: ----------- hist: accept a list of scalars as equivalent to a 1-D ndarray Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-05-03 18:37:38 UTC (rev 8292) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-05-04 05:24:53 UTC (rev 8293) @@ -6187,7 +6187,7 @@ precise point of intersection. Otherwise, the start and end points of the filled region will only occur on explicit values in the *x* array. - + *kwargs* keyword args passed on to the :class:PolyCollection @@ -6254,13 +6254,13 @@ return x[ind-1], y1[ind-1] elif np.ma.is_masked(diff_values[0]): return x[ind], y1[ind] - + diff_order = diff_values.argsort() diff_root_x = np.interp( 0, diff_values[diff_order], x_values[diff_order]) diff_root_y = np.interp(diff_root_x, x_values, y1_values) return diff_root_x, diff_root_y - + start = get_interp_point(ind0) end = get_interp_point(ind1) else: @@ -6272,12 +6272,12 @@ X[0] = start X[N+1] = end - + X[1:N+1,0] = xslice X[1:N+1,1] = y1slice X[N+2:,0] = xslice[::-1] X[N+2:,1] = y2slice[::-1] - + polys.append(X) collection = mcoll.PolyCollection(polys, **kwargs) @@ -7328,7 +7328,7 @@ 'hist now uses the rwidth to give relative width ' 'and not absolute width') - if isinstance(x, np.ndarray): + if isinstance(x, np.ndarray) or not iterable(x[0]): # TODO: support masked arrays; x = np.asarray(x) if x.ndim == 2: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8295] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-05-04 19:46 Revision: 8295 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8295&view=rev Author: leejjoon Date: 2010-05-04 19:46:28 +0000 (Tue, 04 May 2010) Log Message: ----------- Axes.annotate sets _remove_method Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-05-04 17:53:33 UTC (rev 8294) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-05-04 19:46:28 UTC (rev 8295) @@ -3033,6 +3033,7 @@ self._set_artist_props(a) if kwargs.has_key('clip_on'): a.set_clip_path(self.patch) self.texts.append(a) + a._remove_method = lambda h: self.texts.remove(h) return a #### Lines and spans This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8301] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-05-09 02:59 Revision: 8301 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8301&view=rev Author: ryanmay Date: 2010-05-09 02:59:29 +0000 (Sun, 09 May 2010) Log Message: ----------- Clarify axes.scatter docstring slightly for using 'none' as a string instead of the None object. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-05-06 19:59:32 UTC (rev 8300) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-05-09 02:59:29 UTC (rev 8301) @@ -5424,10 +5424,10 @@ particular: *edgecolors*: - 'none' to plot faces with no outlines + The string 'none' to plot faces with no outlines *facecolors*: - 'none' to plot unfilled outlines + The string 'none' to plot unfilled outlines Here are the standard descriptions of all the :class:~matplotlib.collections.Collection kwargs: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8302] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-05-10 18:06 Revision: 8302 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8302&view=rev Author: mdboom Date: 2010-05-10 18:06:45 +0000 (Mon, 10 May 2010) Log Message: ----------- Fix aspect ratio calculation for polar plots. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-05-09 02:59:29 UTC (rev 8301) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-05-10 18:06:45 UTC (rev 8302) @@ -1084,20 +1084,23 @@ aspect = self.get_aspect() - xscale, yscale = self.get_xscale(), self.get_yscale() - if xscale == "linear" and yscale == "linear": + if self.name != 'polar': + xscale, yscale = self.get_xscale(), self.get_yscale() + if xscale == "linear" and yscale == "linear": + aspect_scale_mode = "linear" + elif xscale == "log" and yscale == "log": + aspect_scale_mode = "log" + elif (xscale == "linear" and yscale == "log") or \ + (xscale == "log" and yscale == "linear"): + if aspect is not "auto": + warnings.warn( + 'aspect is not supported for Axes with xscale=%s, yscale=%s' \ + % (xscale, yscale)) + aspect = "auto" + else: # some custom projections have their own scales. + pass + else: aspect_scale_mode = "linear" - elif xscale == "log" and yscale == "log": - aspect_scale_mode = "log" - elif (xscale == "linear" and yscale == "log") or \ - (xscale == "log" and yscale == "linear"): - if aspect is not "auto": - warnings.warn( - 'aspect is not supported for Axes with xscale=%s, yscale=%s' \ - % (xscale, yscale)) - aspect = "auto" - else: # some custom projections have their own scales. - pass if aspect == 'auto': self.set_position( position , which='active') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8306] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-05-10 20:34 Revision: 8306 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8306&view=rev Author: mdboom Date: 2010-05-10 20:34:33 +0000 (Mon, 10 May 2010) Log Message: ----------- [2998906] OverflowError when xscale='log' for hexbin Raises ValueError if trying to log-scale non-positive values. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-05-10 20:17:51 UTC (rev 8305) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-05-10 20:34:33 UTC (rev 8306) @@ -5778,8 +5778,12 @@ x = np.array(x, float) y = np.array(y, float) if xscale=='log': + if np.any(x <= 0.0): + raise ValueError("x contains non-positive values, so can not be log-scaled") x = np.log10(x) if yscale=='log': + if np.any(y <= 0.0): + raise ValueError("y contains non-positive values, so can not be log-scaled") y = np.log10(y) if extent is not None: xmin, xmax, ymin, ymax = extent This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8318] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-05-18 17:14 Revision: 8318 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8318&view=rev Author: leejjoon Date: 2010-05-18 17:14:40 +0000 (Tue, 18 May 2010) Log Message: ----------- fix savefig bug Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-05-17 19:03:58 UTC (rev 8317) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-05-18 17:14:40 UTC (rev 8318) @@ -8002,7 +8002,7 @@ bb.extend([bby1, bby2]) - bb.extend([c.get_window_extent(renderer) for c in artists]) + bb.extend([c.get_window_extent(renderer) for c in artists if c.get_visible()]) _bbox = mtransforms.Bbox.union([b for b in bb if b.width!=0 or b.height!=0]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8340] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-05-28 16:56 Revision: 8340 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8340&view=rev Author: ryanmay Date: 2010-05-28 16:56:45 +0000 (Fri, 28 May 2010) Log Message: ----------- Fix typos in set_xlim docstring. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-05-27 18:56:19 UTC (rev 8339) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-05-28 16:56:45 UTC (rev 8340) @@ -2184,9 +2184,9 @@ Keyword arguments: - *ymin*: scalar + *xmin*: scalar the min of the ylim - *ymax*: scalar + *xmax*: scalar the max of the ylim *emit*: [ True | False ] notify observers of lim change This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8349] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-05-31 00:15 Revision: 8349 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8349&view=rev Author: efiring Date: 2010-05-31 00:14:03 +0000 (Mon, 31 May 2010) Log Message: ----------- set_yscale should autoscale only y, etc. closes 2872466 Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-05-30 23:58:27 UTC (rev 8348) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-05-31 00:14:03 UTC (rev 8349) @@ -2246,7 +2246,7 @@ %(scale_docs)s """ self.xaxis.set_scale(value, **kwargs) - self.autoscale_view() + self.autoscale_view(scaley=False) self._update_transScale() def get_xticks(self, minor=False): @@ -2420,7 +2420,7 @@ %(scale_docs)s """ self.yaxis.set_scale(value, **kwargs) - self.autoscale_view() + self.autoscale_view(scalex=False) self._update_transScale() def get_yticks(self, minor=False): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8353] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-05-31 21:59 Revision: 8353 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8353&view=rev Author: efiring Date: 2010-05-31 21:59:06 +0000 (Mon, 31 May 2010) Log Message: ----------- Axes.hist: rework autoscaling. Closes 2971357. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-05-31 19:41:20 UTC (rev 8352) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-05-31 21:59:06 UTC (rev 8353) @@ -7396,9 +7396,21 @@ w = [None]*nx # Check whether bins or range are given explicitly. In that - # case do not autoscale axes. + # case use those values for autoscaling. binsgiven = (cbook.iterable(bins) or range != None) + # Save autoscale state for later restoration; turn autoscaling + # off so we can do it all a single time at the end, instead + # of having it done by bar or fill and then having to be redone. + _saved_autoscalex = self.get_autoscalex_on() + _saved_autoscaley = self.get_autoscaley_on() + self.set_autoscalex_on(False) + self.set_autoscaley_on(False) + + # Save the datalimits for the same reason: + _saved_bounds = self.dataLim.bounds + + hist_kwargs = dict(range=range, normed=bool(normed)) if np.__version__ < "1.3": # version 1.1 and 1.2 hist_kwargs['new'] = True @@ -7503,18 +7515,21 @@ # adopted from adjust_x/ylim part of the bar method if orientation == 'horizontal': - xmin, xmax = 0, self.dataLim.intervalx[1] + xmin0 = max(_saved_bounds[0]*0.9, 1e-100) + xmax = self.dataLim.intervalx[1] for m in n: xmin = np.amin(m[m!=0]) # filter out the 0 height bins xmin = max(xmin*0.9, 1e-100) + xmin = min(xmin0, xmin) self.dataLim.intervalx = (xmin, xmax) elif orientation == 'vertical': - ymin, ymax = 0, self.dataLim.intervaly[1] + ymin0 = max(_saved_bounds[1]*0.9, 1e-100) + ymax = self.dataLim.intervaly[1] for m in n: ymin = np.amin(m[m!=0]) # filter out the 0 height bins ymin = max(ymin*0.9, 1e-100) + ymin = min(ymin0, ymin) self.dataLim.intervaly = (ymin, ymax) - self.autoscale_view() if label is None: labels = ['_nolegend_'] @@ -7535,18 +7550,15 @@ lbl = '_nolegend_' if binsgiven: - self.set_autoscale_on(False) if orientation == 'vertical': - self.autoscale_view(scalex=False, scaley=True) - XL = self.xaxis.get_major_locator().view_limits( - bins[0], bins[-1]) - self.set_xbound(XL) + self.update_datalim([(bins[0],0), (bins[-1],0)], updatey=False) else: - self.autoscale_view(scalex=True, scaley=False) - YL = self.yaxis.get_major_locator().view_limits( - bins[0], bins[-1]) - self.set_ybound(YL) + self.update_datalim([(0,bins[0]), (0,bins[-1])], updatex=False) + self.set_autoscalex_on(_saved_autoscalex) + self.set_autoscaley_on(_saved_autoscaley) + self.autoscale_view() + if nx == 1: return n[0], bins, cbook.silent_list('Patch', patches[0]) else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8354] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-05-31 23:06 Revision: 8354 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8354&view=rev Author: efiring Date: 2010-05-31 23:05:55 +0000 (Mon, 31 May 2010) Log Message: ----------- Axes.hist: fix auto range selection with multiple datasets. Close 2976990. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-05-31 21:59:06 UTC (rev 8353) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-05-31 23:05:55 UTC (rev 8354) @@ -7230,9 +7230,9 @@ are ignored. If not provided, *range* is (x.min(), x.max()). Range has no effect if *bins* is a sequence. - If *bins* is a sequence or *range* is specified, autoscaling is - set off (*autoscale_on* is set to *False*) and the xaxis limits - are set to encompass the full specified bin range. + If *bins* is a sequence or *range* is specified, autoscaling + is based on the specified bin range instead of the + range of x. *normed*: If *True*, the first element of the return tuple will @@ -7395,9 +7395,6 @@ else: w = [None]*nx - # Check whether bins or range are given explicitly. In that - # case use those values for autoscaling. - binsgiven = (cbook.iterable(bins) or range != None) # Save autoscale state for later restoration; turn autoscaling # off so we can do it all a single time at the end, instead @@ -7410,7 +7407,21 @@ # Save the datalimits for the same reason: _saved_bounds = self.dataLim.bounds + # Check whether bins or range are given explicitly. In that + # case use those values for autoscaling. + binsgiven = (cbook.iterable(bins) or range != None) + # If bins are not specified either explicitly or via range, + # we need to figure out the range required for all datasets, + # and supply that to np.histogram. + if not binsgiven: + xmin = np.inf + xmax = -np.inf + for xi in x: + xmin = min(xmin, xi.min()) + xmax = max(xmax, xi.max()) + range = (xmin, xmax) + hist_kwargs = dict(range=range, normed=bool(normed)) if np.__version__ < "1.3": # version 1.1 and 1.2 hist_kwargs['new'] = True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8359] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-06-01 02:36 Revision: 8359 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8359&view=rev Author: efiring Date: 2010-06-01 02:36:47 +0000 (Tue, 01 Jun 2010) Log Message: ----------- Axes.axhline, axvline: explicitly disallow transform kwarg. Closes 2864449. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-06-01 02:20:53 UTC (rev 8358) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-06-01 02:36:47 UTC (rev 8359) @@ -3087,7 +3087,8 @@ >>> axhline(y=.5, xmin=0.25, xmax=0.75) - Valid kwargs are :class:~matplotlib.lines.Line2D properties: + Valid kwargs are :class:~matplotlib.lines.Line2D properties, + with the exception of 'transform': %(Line2D)s @@ -3097,6 +3098,10 @@ for example plot and source code """ + if "transform" in kwargs: + raise ValueError( + "'transform' is not allowed as a kwarg;" + + "axhline generates its own transform.") ymin, ymax = self.get_ybound() # We need to strip away the units for comparison with @@ -3147,7 +3152,8 @@ >>> axvline(x=.5, ymin=0.25, ymax=0.75) - Valid kwargs are :class:~matplotlib.lines.Line2D properties: + Valid kwargs are :class:~matplotlib.lines.Line2D properties, + with the exception of 'transform': %(Line2D)s @@ -3157,6 +3163,10 @@ for example plot and source code """ + if "transform" in kwargs: + raise ValueError( + "'transform' is not allowed as a kwarg;" + + "axvline generates its own transform.") xmin, xmax = self.get_xbound() # We need to strip away the units for comparison with This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8360] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-06-01 03:11 Revision: 8360 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8360&view=rev Author: efiring Date: 2010-06-01 03:11:39 +0000 (Tue, 01 Jun 2010) Log Message: ----------- Axes.bar: let errorbar take care of most checking and processing of xerr, yerr. Closes 2804500. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-06-01 02:36:47 UTC (rev 8359) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-06-01 03:11:39 UTC (rev 8360) @@ -4306,6 +4306,9 @@ *xerr*, and *yerr* can be either scalars or sequences of length equal to the number of bars. This enables you to use bar as the basis for stacked bar charts, or candlestick plots. + Detail: *xerr* and *yerr* are passed directly to + :meth:errorbar, so they can also have shape 2xN for + independent specification of lower and upper errors. Other optional kwargs: @@ -4319,6 +4322,9 @@ color = kwargs.pop('color', None) edgecolor = kwargs.pop('edgecolor', None) linewidth = kwargs.pop('linewidth', None) + # Because xerr and yerr will be passed to errorbar, + # most dimension checking and processing will be left + # to the errorbar method. xerr = kwargs.pop('xerr', None) yerr = kwargs.pop('yerr', None) ecolor = kwargs.pop('ecolor', None) @@ -4396,14 +4402,6 @@ if len(edgecolor) < nbars: edgecolor *= nbars - if yerr is not None: - if not iterable(yerr): - yerr = [yerr]*nbars - - if xerr is not None: - if not iterable(xerr): - xerr = [xerr]*nbars - # FIXME: convert the following to proper input validation # raising ValueError; don't use assert for this. assert len(left)==nbars, "incompatible sizes: argument 'left' must be length %d or scalar" % nbars @@ -4414,13 +4412,6 @@ assert len(bottom)==nbars, ("incompatible sizes: argument 'bottom' must be length %d or scalar" % nbars) - if yerr is not None and len(yerr)!=nbars: - raise ValueError( - "incompatible sizes: bar() argument 'yerr' must be len(%s) or scalar" % nbars) - if xerr is not None and len(xerr)!=nbars: - raise ValueError( - "incompatible sizes: bar() argument 'xerr' must be len(%s) or scalar" % nbars) - patches = [] # lets do some conversions now since some types cannot be This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8399] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-06-09 03:01 Revision: 8399 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8399&view=rev Author: efiring Date: 2010-06-09 03:01:53 +0000 (Wed, 09 Jun 2010) Log Message: ----------- [2982047] start default collection label with underscore, like line label Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-06-08 22:41:10 UTC (rev 8398) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-06-09 03:01:53 UTC (rev 8399) @@ -1398,7 +1398,7 @@ ''' label = collection.get_label() if not label: - collection.set_label('collection%d'%len(self.collections)) + collection.set_label('_collection%d'%len(self.collections)) self.collections.append(collection) self._set_artist_props(collection) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8429] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-06-14 00:54 Revision: 8429 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8429&view=rev Author: efiring Date: 2010-06-14 00:54:41 +0000 (Mon, 14 Jun 2010) Log Message: ----------- [1467533] pie shadows are tagged with _nolabel_ Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-06-13 23:04:30 UTC (rev 8428) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-06-14 00:54:41 UTC (rev 8429) @@ -4777,6 +4777,7 @@ #props={'facecolor':w.get_facecolor()} ) shad.set_zorder(0.9*w.get_zorder()) + shad.set_label('_nolegend_') self.add_patch(shad) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8452] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-06-21 20:53 Revision: 8452 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8452&view=rev Author: efiring Date: 2010-06-21 20:53:22 +0000 (Mon, 21 Jun 2010) Log Message: ----------- Let pcolor antialiasing default be controlled by patch.antialiasing. See ticket 3017725. In most cases antialiasing is better than, or nearly as good as, non-antialiasing. A note about artifacts is now in the docstring. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-06-21 20:37:27 UTC (rev 8451) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-06-21 20:53:22 UTC (rev 8452) @@ -6740,16 +6740,16 @@ *shading*: [ 'flat' | 'faceted' ] If 'faceted', a black grid is drawn around each rectangle; if 'flat', edges are not drawn. Default is 'flat', contrary to - Matlab(TM). + Matlab. This kwarg is deprecated; please use 'edgecolors' instead: - * shading='flat' -- edgecolors='None' + * shading='flat' -- edgecolors='none' * shading='faceted -- edgecolors='k' - *edgecolors*: [ None | 'None' | color | color sequence] + *edgecolors*: [ None | 'none' | color | color sequence] If *None*, the rc setting is used by default. - If 'None', edges will not be visible. + If 'none', edges will not be visible. An mpl color or sequence of colors will set the edge color @@ -6805,6 +6805,16 @@ :class:~matplotlib.collection.PolyCollection properties: %(PolyCollection)s + + Note: the default *antialiaseds* is taken from + rcParams['patch.antialiased'], which defaults to *True*. + In some cases, particularly if *alpha* is 1, + you may be able to reduce rendering artifacts (light or + dark patch boundaries) by setting it to *False*. An + alternative it to set *edgecolors* to 'face'. Unfortunately, + there seems to be no single combination of parameters that + eliminates artifacts under all conditions. + """ if not self._hold: self.cla() @@ -6850,19 +6860,22 @@ axis=1) verts = xy.reshape((npoly, 5, 2)) - #verts = zip(zip(X1,Y1),zip(X2,Y2),zip(X3,Y3),zip(X4,Y4)) - C = compress(ravelmask, ma.filled(C[0:Ny-1,0:Nx-1]).ravel()) - if shading == 'faceted': - edgecolors = (0,0,0,1), - linewidths = (0.25,) + edgecolors = 'k', else: - edgecolors = 'face' - linewidths = (1.0,) + edgecolors = 'none' + linewidths = (0.25,) + # Not sure if we want to have the following, or just trap + # invalid kwargs and raise an exception. + if 'edgecolor' in kwargs: + kwargs['edgecolors'] = kwargs.pop('edgecolor') + if 'linewidth' in kwargs: + kwargs['linewidths'] = kwargs.pop('linewidth') + if 'antialiased' in kwargs: + kwargs['antialiaseds'] = kwargs.pop('antialiased') kwargs.setdefault('edgecolors', edgecolors) - kwargs.setdefault('antialiaseds', (0,)) kwargs.setdefault('linewidths', linewidths) collection = mcoll.PolyCollection(verts, **kwargs) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8453] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-06-21 21:41 Revision: 8453 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8453&view=rev Author: efiring Date: 2010-06-21 21:41:19 +0000 (Mon, 21 Jun 2010) Log Message: ----------- tick_params: fixed errors in handling top, bottom, etc. kwargs. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-06-21 20:53:22 UTC (rev 8452) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-06-21 21:41:19 UTC (rev 8453) @@ -2168,13 +2168,17 @@ """ if axis in ['x', 'both']: xkw = dict(kwargs) - xkw.pop('top', None) - xkw.pop('bottom', None) + xkw.pop('left', None) + xkw.pop('right', None) + xkw.pop('labelleft', None) + xkw.pop('labelright', None) self.xaxis.set_tick_params(**xkw) if axis in ['y', 'both']: ykw = dict(kwargs) - ykw.pop('left', None) - ykw.pop('right', None) + ykw.pop('top', None) + ykw.pop('bottom', None) + ykw.pop('labeltop', None) + ykw.pop('labelbottom', None) self.yaxis.set_tick_params(**ykw) def set_axis_off(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. 

 SF.net SVN: matplotlib:[8491] trunk/matplotlib/lib/matplotlib/axes.py From: - 2010-07-03 05:09 Revision: 8491 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8491&view=rev Author: efiring Date: 2010-07-03 05:09:49 +0000 (Sat, 03 Jul 2010) Log Message: ----------- fix new bugs in handling of xlim, ylim, margins Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-07-03 01:20:53 UTC (rev 8490) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-07-03 05:09:49 UTC (rev 8491) @@ -830,7 +830,7 @@ self.xaxis.major = self._sharex.xaxis.major self.xaxis.minor = self._sharex.xaxis.minor x0, x1 = self._sharex.get_xlim() - self.set_xlim(x0, x1, emit=False) + self.set_xlim(x0, x1, emit=False, auto=None) self.xaxis.set_scale(self._sharex.xaxis.get_scale()) else: self.xaxis.set_scale('linear') @@ -839,7 +839,7 @@ self.yaxis.major = self._sharey.yaxis.major self.yaxis.minor = self._sharey.yaxis.minor y0, y1 = self._sharey.get_ylim() - self.set_ylim(y0, y1, emit=False) + self.set_ylim(y0, y1, emit=False, auto=None) self.yaxis.set_scale(self._sharey.yaxis.get_scale()) else: self.yaxis.set_scale('linear') @@ -1678,7 +1678,7 @@ *tight* to *None* will preserve the previous setting. Specifying any margin changes only the autoscaling; for example, - if *xmargin* is not zero, then *xmargin* times the X data + if *xmargin* is not None, then *xmargin* times the X data interval will be added to each end of that interval before it is used in autoscaling. @@ -1700,9 +1700,12 @@ if my is not None: self.set_ymargin(my) - self.autoscale_view(tight=tight, scalex=bool(mx), scaley=bool(my)) + scalex = (mx is not None) + scaley = (my is not None) + self.autoscale_view(tight=tight, scalex=scalex, scaley=scaley) + def set_rasterization_zorder(self, z): """ Set zorder value below which artists will be rasterized @@ -2368,7 +2371,8 @@ # Call all of the other x-axes that are shared with this one for other in self._shared_x_axes.get_siblings(self): if other is not self: - other.set_xlim(self.viewLim.intervalx, emit=False) + other.set_xlim(self.viewLim.intervalx, + emit=False, auto=auto) if (other.figure != self.figure and other.figure.canvas is not None): other.figure.canvas.draw_idle() @@ -2561,7 +2565,8 @@ # Call all of the other y-axes that are shared with this one for other in self._shared_y_axes.get_siblings(self): if other is not self: - other.set_ylim(self.viewLim.intervaly, emit=False) + other.set_ylim(self.viewLim.intervaly, + emit=False, auto=auto) if (other.figure != self.figure and other.figure.canvas is not None): other.figure.canvas.draw_idle() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.