From: <ry...@us...> - 2010-05-28 16:56:51
|
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. |
From: <ef...@us...> - 2010-05-31 00:15:47
|
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. |
From: <ef...@us...> - 2010-05-31 21:59:15
|
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. |
From: <ef...@us...> - 2010-05-31 23:06:01
|
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. |
From: <ef...@us...> - 2010-06-01 02:36:53
|
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. |
From: <ef...@us...> - 2010-06-01 03:11:45
|
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. |
From: <ef...@us...> - 2010-06-09 03:01:59
|
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. |
From: <ef...@us...> - 2010-06-14 00:54:48
|
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. |
From: <ef...@us...> - 2010-06-21 20:53:29
|
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. |
From: <ef...@us...> - 2010-06-21 21:41:25
|
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. |
From: <ef...@us...> - 2010-07-03 05:09:56
|
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. |