From: <md...@us...> - 2008-10-23 17:21:53
|
Revision: 6311 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6311&view=rev Author: mdboom Date: 2008-10-23 17:21:49 +0000 (Thu, 23 Oct 2008) Log Message: ----------- Fix collections property list. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/artist.py trunk/matplotlib/lib/matplotlib/collections.py Modified: trunk/matplotlib/lib/matplotlib/artist.py =================================================================== --- trunk/matplotlib/lib/matplotlib/artist.py 2008-10-23 16:38:04 UTC (rev 6310) +++ trunk/matplotlib/lib/matplotlib/artist.py 2008-10-23 17:21:49 UTC (rev 6311) @@ -651,7 +651,7 @@ if not self.is_alias(func): continue docstring = func.__doc__ fullname = docstring[10:] - aliases[fullname[4:]] = name[4:] + aliases.setdefault(fullname[4:], []).append(name[4:]) return aliases _get_valid_values_regex = re.compile(r"\n\s*ACCEPTS:\s*((?:.|\n)*?)(?:$|(?:\n\n))") @@ -731,8 +731,10 @@ """ if s in self.aliasd: - return ':meth:`%s <%s>` or %s' % (s, target, self.aliasd[s]) - else: return ':meth:`%s <%s>`' % (s, target) + aliases = ''.join([' or %s' % x for x in self.aliasd[s]]) + else: + aliases = '' + return ':meth:`%s <%s>`%s' % (s, target, aliases) def pprint_setters(self, prop=None, leadingspace=2): """ Modified: trunk/matplotlib/lib/matplotlib/collections.py =================================================================== --- trunk/matplotlib/lib/matplotlib/collections.py 2008-10-23 16:38:04 UTC (rev 6310) +++ trunk/matplotlib/lib/matplotlib/collections.py 2008-10-23 17:21:49 UTC (rev 6311) @@ -253,7 +253,7 @@ else: return self._uniform_offsets - def set_linewidths(self, lw): + def set_linewidth(self, lw): """ Set the linewidth(s) for the collection. *lw* can be a scalar or a sequence; if it is a sequence the patches will cycle @@ -263,11 +263,18 @@ """ if lw is None: lw = mpl.rcParams['patch.linewidth'] self._linewidths = self._get_value(lw) - set_lw = set_linewidth = set_linewidths - def set_linestyles(self, ls): + def set_linewidths(self, lw): + """alias for set_linewidth""" + return self.set_linewidth(lw) + + def set_lw(self, lw): + """alias for set_linewidth""" + return self.set_linewidth(lw) + + def set_linestyle(self, ls): """ - Set the linestyles(s) for the collection. + Set the linestyle(s) for the collection. ACCEPTS: ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ] @@ -306,8 +313,15 @@ except ValueError: raise ValueError('Do not know how to convert %s to dashes'%ls) self._linestyles = dashes - set_dashes = set_linestyle = set_linestyles + def set_linestyles(self, ls): + """alias for set_linestyle""" + return self.set_linestyle(ls) + + def set_dashes(self, ls): + """alias for set_linestyle""" + return self.set_linestyle(ls) + def set_antialiased(self, aa): """ Set the antialiasing state for rendering. @@ -317,8 +331,11 @@ if aa is None: aa = mpl.rcParams['patch.antialiased'] self._antialiaseds = self._get_bool(aa) - set_antialiaseds = set_antialiased + def set_antialiaseds(self, aa): + """alias for set_antialiased""" + return self.set_antialiased(aa) + def set_color(self, c): """ Set both the edgecolor and the facecolor. @@ -344,7 +361,9 @@ self._facecolors_original = c self._facecolors = _colors.colorConverter.to_rgba_array(c, self._alpha) - set_facecolors = set_facecolor + def set_facecolors(self, c): + """alias for set_facecolor""" + return self.set_facecolor(c) def get_facecolor(self): return self._facecolors @@ -377,7 +396,9 @@ self._edgecolors_original = c self._edgecolors = _colors.colorConverter.to_rgba_array(c, self._alpha) - set_edgecolors = set_edgecolor + def set_edgecolors(self, c): + """alias for set_edgecolor""" + return self.set_edgecolor(c) def set_alpha(self, alpha): """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |