From: <md...@us...> - 2008-10-16 17:32:49
|
Revision: 6223 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6223&view=rev Author: mdboom Date: 2008-10-16 17:32:39 +0000 (Thu, 16 Oct 2008) Log Message: ----------- Improve auto-generated property tables to have links from the name of the property to the setter method. This is useful since many properties are not self-explanatory from their "ACCEPTS" list alone. Parse multi-line "ACCEPTS" statements in docstrings. Clean-up markup in FancyBoxPatch and related classes. Syntax highlight ipython session example. Judicious use of "seealso::" Lots of grammatical and capitalization clean-up Modified Paths: -------------- trunk/matplotlib/doc/devel/outline.rst trunk/matplotlib/doc/users/shell.rst trunk/matplotlib/lib/matplotlib/artist.py trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/backend_bases.py trunk/matplotlib/lib/matplotlib/collections.py trunk/matplotlib/lib/matplotlib/colors.py trunk/matplotlib/lib/matplotlib/dates.py trunk/matplotlib/lib/matplotlib/image.py trunk/matplotlib/lib/matplotlib/lines.py trunk/matplotlib/lib/matplotlib/mathtext.py trunk/matplotlib/lib/matplotlib/mlab.py trunk/matplotlib/lib/matplotlib/patches.py trunk/matplotlib/lib/matplotlib/path.py trunk/matplotlib/lib/matplotlib/pyplot.py trunk/matplotlib/lib/matplotlib/text.py trunk/matplotlib/lib/matplotlib/ticker.py trunk/matplotlib/lib/matplotlib/transforms.py Modified: trunk/matplotlib/doc/devel/outline.rst =================================================================== --- trunk/matplotlib/doc/devel/outline.rst 2008-10-16 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/doc/devel/outline.rst 2008-10-16 17:32:39 UTC (rev 6223) @@ -75,7 +75,7 @@ there. ==================== =========== =================== -Module Author Status +Module Author Status ==================== =========== =================== backend_agg needs conversion backend_cairo needs conversion @@ -143,7 +143,7 @@ scale needs conversion table needs conversion texmanager Darren needs conversion -text Mike needs conversion +text Mike converted ticker Mike needs conversion transforms needs conversion type1font needs conversion Modified: trunk/matplotlib/doc/users/shell.rst =================================================================== --- trunk/matplotlib/doc/users/shell.rst 2008-10-16 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/doc/users/shell.rst 2008-10-16 17:32:39 UTC (rev 6223) @@ -25,8 +25,9 @@ Fortunately, `ipython <http://ipython.scipy.org/dist>`_, an enhanced interactive python shell, has figured out all of these tricks, and is -matplotlib aware, so when you start ipython in the *pylab* mode:: +matplotlib aware, so when you start ipython in the *pylab* mode. +.. sourcecode:: ipython johnh@flag:~> ipython -pylab Python 2.4.5 (#4, Apr 12 2008, 09:09:16) Modified: trunk/matplotlib/lib/matplotlib/artist.py =================================================================== --- trunk/matplotlib/lib/matplotlib/artist.py 2008-10-16 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/artist.py 2008-10-16 17:32:39 UTC (rev 6223) @@ -81,14 +81,14 @@ # TODO: add legend support def have_units(self): - 'return *True* if units are set on the x or y axes' + 'Return *True* if units are set on the *x* or *y* axes' ax = self.axes if ax is None or ax.xaxis is None: return False return ax.xaxis.have_units() or ax.yaxis.have_units() def convert_xunits(self, x): - """for artists in an axes, if the xaxis as units support, + """For artists in an axes, if the xaxis has units support, convert *x* using xaxis unit type """ ax = getattr(self, 'axes', None) @@ -98,7 +98,7 @@ return ax.xaxis.convert_units(x) def convert_yunits(self, y): - """for artists in an axes, if the yaxis as units support, + """For artists in an axes, if the yaxis has units support, convert *y* using yaxis unit type """ ax = getattr(self, 'axes', None) @@ -107,39 +107,64 @@ def set_axes(self, axes): """ - set the axes instance in which the artist resides, if any + Set the :class:`~matplotlib.axes.Axes` instance in which the + artist resides, if any. - ACCEPTS: an axes instance + ACCEPTS: an :class:`~matplotlib.axes.Axes` instance """ self.axes = axes def get_axes(self): - 'return the axes instance the artist resides in, or *None*' + """ + Return the :class:`~matplotlib.axes.Axes` instance the artist + resides in, or *None* + """ return self.axes def add_callback(self, func): + """ + Adds a callback function that will be called whenever one of + the :class:`Artist`'s properties changes. + + Returns an *id* that is useful for removing the callback with + :meth:`remove_callback` later. + """ oid = self._oid self._propobservers[oid] = func self._oid += 1 return oid def remove_callback(self, oid): + """ + Remove a callback based on its *id*. + + .. seealso:: + :meth:`add_callback` + """ try: del self._propobservers[oid] except KeyError: pass def pchanged(self): - 'fire event when property changed' + """ + Fire an event when property changed, calling all of the + registered callbacks. + """ for oid, func in self._propobservers.items(): func(self) def is_transform_set(self): - 'Artist has transform explicity let' + """ + Returns *True* if :class:`Artist` has a transform explicitly + set. + """ return self._transformSet def set_transform(self, t): """ Set the :class:`~matplotlib.transforms.Transform` instance used by this artist. + + ACCEPTS: :class:`~matplotlib.transforms.Transform` instance """ self._transform = t self._transformSet = True @@ -154,8 +179,10 @@ self._transform = IdentityTransform() return self._transform - def hitlist(self,event): - """List the children of the artist which contain the mouse event""" + def hitlist(self, event): + """ + List the children of the artist which contain the mouse event *event*. + """ import traceback L = [] try: @@ -172,7 +199,10 @@ return L def get_children(self): - 'return a list of the child artist this artist contains' + """ + Return a list of the child :class:`Artist`s this + :class:`Artist` contains. + """ return [] def contains(self, mouseevent): @@ -188,23 +218,29 @@ return False,{} def set_contains(self,picker): - """Replace the contains test used by this artist. The new picker should - be a callable function which determines whether the artist is hit by the - mouse event:: + """ + Replace the contains test used by this artist. The new picker + should be a callable function which determines whether the + artist is hit by the mouse event:: hit, props = picker(artist, mouseevent) - If the mouse event is over the artist, return *hit=True* and *props* - is a dictionary of properties you want returned with the contains test. + If the mouse event is over the artist, return *hit* = *True* + and *props* is a dictionary of properties you want returned + with the contains test. + + ACCEPTS: a callable function """ self._contains = picker def get_contains(self): - 'return the _contains test used by the artist, or *None* for default.' + """ + Return the _contains test used by the artist, or *None* for default. + """ return self._contains def pickable(self): - 'return *True* if self is pickable' + 'Return *True* if :class:`Artist` is pickable.' return (self.figure is not None and self.figure.canvas is not None and self._picker is not None) @@ -234,7 +270,7 @@ def set_picker(self, picker): """ - set the epsilon for picking used by this artist + Set the epsilon for picking used by this artist *picker* can be one of the following: @@ -267,10 +303,14 @@ self._picker = picker def get_picker(self): - 'return the Pickeration instance used by this artist' + 'Return the picker object used by this artist' return self._picker def is_figure_set(self): + """ + Returns True if the artist is assigned to a + :class:`~matplotlib.figure.Figure`. + """ return self.figure is not None def get_figure(self): @@ -292,9 +332,9 @@ def set_clip_box(self, clipbox): """ - Set the artist's clip Bbox + Set the artist's clip :class:`~matplotlib.transforms.Bbox`. - ACCEPTS: a :class:`matplotlib.transform.Bbox` instance + ACCEPTS: a :class:`matplotlib.transforms.Bbox` instance """ self.clipbox = clipbox self.pchanged() @@ -316,9 +356,9 @@ rectangle, this method will set the clipping box to the corresponding rectangle and set the clipping path to *None*. - ACCEPTS: a :class:`~matplotlib.path.Path` instance and a - :class:`~matplotlib.transforms.Transform` instance, a - :class:`~matplotlib.patches.Patch` instance, or *None*. + ACCEPTS: [ (:class:`~matplotlib.path.Path`, + :class:`~matplotlib.transforms.Transform`) | + :class:`~matplotlib.patches.Patch` | None ] """ from patches import Patch, Rectangle @@ -355,11 +395,11 @@ return self._alpha def get_visible(self): - "return the artist's visiblity" + "Return the artist's visiblity" return self._visible def get_animated(self): - "return the artist's animated state" + "Return the artist's animated state" return self._animated def get_clip_on(self): @@ -386,7 +426,7 @@ def set_clip_on(self, b): """ - Set whether artist uses clipping + Set whether artist uses clipping. ACCEPTS: [True | False] """ @@ -394,7 +434,7 @@ self.pchanged() def _set_gc_clip(self, gc): - 'set the clip properly for the gc' + 'Set the clip properly for the gc' if self._clipon: if self.clipbox is not None: gc.set_clip_rectangle(self.clipbox) @@ -412,7 +452,7 @@ Set the alpha value used for blending - not supported on all backends - ACCEPTS: float + ACCEPTS: float (0.0 transparent through 1.0 opaque) """ self._alpha = alpha self.pchanged() @@ -430,7 +470,7 @@ def set_visible(self, b): """ - set the artist's visiblity + Set the artist's visiblity. ACCEPTS: [True | False] """ @@ -440,7 +480,7 @@ def set_animated(self, b): """ - set the artist's animation state + Set the artist's animation state. ACCEPTS: [True | False] """ @@ -448,6 +488,10 @@ self.pchanged() def update(self, props): + """ + Update the properties of this :class:`Artist` from the + dictionary *prop*. + """ store = self.eventson self.eventson = False changed = False @@ -462,11 +506,14 @@ def get_label(self): + """ + Get the label used for this artist in the legend. + """ return self._label def set_label(self, s): """ - Set the line label to *s* for auto legend + Set the label to *s* for auto legend. ACCEPTS: any string """ @@ -475,11 +522,16 @@ - def get_zorder(self): return self.zorder + def get_zorder(self): + """ + Return the :class:`Artist`'s zorder. + """ + return self.zorder def set_zorder(self, level): """ - Set the zorder for the artist + Set the zorder for the artist. Artists with lower zorder + values are drawn first. ACCEPTS: any number """ @@ -600,7 +652,7 @@ aliases[fullname[4:]] = name[4:] return aliases - _get_valid_values_regex = re.compile(r"\n\s*ACCEPTS:\s*(.*)\n") + _get_valid_values_regex = re.compile(r"\n\s*ACCEPTS:\s*((?:.|\n)*?)(?:$|(?:\n\n))") def get_valid_values(self, attr): """ Get the legal arguments for the setter associated with *attr*. @@ -625,25 +677,38 @@ match = self._get_valid_values_regex.search(docstring) if match is not None: - return match.group(1) + return match.group(1).replace('\n', ' ') return 'unknown' - def get_setters(self): + def _get_setters_and_targets(self): """ - Get the attribute strings with setters for object. Eg., for a line, - return ``['markerfacecolor', 'linewidth', ....]``. + Get the attribute strings and a full path to where the setter + is defined for all setters in an object. """ setters = [] for name in dir(self.o): if not name.startswith('set_'): continue - o = getattr(self.o,name) + o = getattr(self.o, name) if not callable(o): continue func = o if self.is_alias(func): continue - setters.append(name[4:]) + source_class = self.o.__module__ + "." + self.o.__name__ + for cls in self.o.mro(): + if name in cls.__dict__: + source_class = cls.__module__ + "." + cls.__name__ + break + setters.append((name[4:], source_class + "." + name)) return setters + def get_setters(self): + """ + Get the attribute strings with setters for object. Eg., for a line, + return ``['markerfacecolor', 'linewidth', ....]``. + """ + + return [prop for prop, target in self._get_setters_and_targets()] + def is_alias(self, o): """ Return *True* if method object *o* is an alias for another @@ -653,7 +718,7 @@ if ds is None: return False return ds.startswith('alias for ') - def aliased_name(self, s): + def aliased_name(self, s, target): """ return 'PROPNAME or alias' if *s* has an alias, else return PROPNAME. @@ -662,9 +727,10 @@ alias, return 'markerfacecolor or mfc' and for the transform property, which does not, return 'transform' """ + if s in self.aliasd: - return '%s or %s' % (s, self.aliasd[s]) - else: return s + return ':meth:`%s <%s>` or %s' % (s, target, self.aliasd[s]) + else: return ':meth:`%s <%s>`' % (s, target) def pprint_setters(self, prop=None, leadingspace=2): """ @@ -683,13 +749,13 @@ accepts = self.get_valid_values(prop) return '%s%s: %s' %(pad, prop, accepts) - attrs = self.get_setters() + attrs = self._get_setters_and_targets() attrs.sort() lines = [] ######## - names = [self.aliased_name(prop) for prop in attrs] - accepts = [self.get_valid_values(prop) for prop in attrs] + names = [self.aliased_name(prop, target) for prop, target in attrs] + accepts = [self.get_valid_values(prop) for prop, target in attrs] col0_len = max([len(n) for n in names]) col1_len = max([len(a) for a in accepts]) @@ -709,9 +775,9 @@ return lines ######## - for prop in attrs: + for prop, path in attrs: accepts = self.get_valid_values(prop) - name = self.aliased_name(prop) + name = self.aliased_name(prop, path) lines.append('%s%s: %s' %(pad, name, accepts)) return lines @@ -792,17 +858,17 @@ getp(o, 'linestyle') # get the linestyle property - o is a :class:`Artist` instance, eg + *o* is a :class:`Artist` instance, eg :class:`~matplotllib.lines.Line2D` or an instance of a :class:`~matplotlib.axes.Axes` or :class:`matplotlib.text.Text`. If the *property* is 'somename', this function returns o.get_somename() - getp can be used to query all the gettable properties with getp(o) - Many properties have aliases for shorter typing, eg 'lw' is an - alias for 'linewidth'. In the output, aliases and full property - names will be listed as:: + :func:`getp` can be used to query all the gettable properties with + ``getp(o)``. Many properties have aliases for shorter typing, e.g. + 'lw' is an alias for 'linewidth'. In the output, aliases and full + property names will be listed as:: property or alias = value Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-16 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-16 17:32:39 UTC (rev 6223) @@ -41,10 +41,10 @@ * '.b': blue dots * 'r--': red dashed lines - See :func:`~matplotlib.Line2D.lineStyles` and - :func:`~matplotlib.pyplot.colors` for all possible styles and - color format string. - + .. seealso:: + :func:`~matplotlib.Line2D.lineStyles` and + :func:`~matplotlib.pyplot.colors`: + for all possible styles and color format string. """ linestyle = None @@ -419,12 +419,11 @@ :class:`~matplotlib.patches.Polygon`, etc., and sets the coordinate system. - The :class:`Axes` instance supports callbacks through a callbacks attribute - which is a :class:`~matplotlib.cbook.CallbackRegistry` instance. - The events you can connect to are :meth:`xlim_changed` and - :meth:`ylim_changed` and the callback will be called with - func(*ax() where *ax* is the :class:`Axes` instance. - + The :class:`Axes` instance supports callbacks through a callbacks + attribute which is a :class:`~matplotlib.cbook.CallbackRegistry` + instance. The events you can connect to are 'xlim_changed' and + 'ylim_changed' and the callback will be called with func(*ax*) + where *ax* is the :class:`Axes` instance. """ name = "rectilinear" @@ -2493,13 +2492,16 @@ set_title(label, fontdict=None, **kwargs): - Set the title for the axes. See the :meth:`text` for - information of how override and the optional args work + Set the title for the axes. kwargs are Text properties: %(Text)s ACCEPTS: str + + .. seealso:: + :meth:`text`: + for information on how override and the optional args work """ default = { 'fontsize':rcParams['axes.titlesize'], @@ -2527,12 +2529,15 @@ set_xlabel(xlabel, fontdict=None, **kwargs) - Set the label for the xaxis. See the :meth:`text` docstring - for information of how override and the optional args work. + Set the label for the xaxis. Valid kwargs are Text properties: %(Text)s ACCEPTS: str + + .. seealso:: + :meth:`text`: + for information on how override and the optional args work """ label = self.xaxis.get_label() @@ -2557,12 +2562,13 @@ Set the label for the yaxis - See the :meth:`text` doctstring for information of how - override and the optional args work - Valid kwargs are Text properties: %(Text)s ACCEPTS: str + + .. seealso:: + :meth:`text`: + for information on how override and the optional args work """ label = self.yaxis.get_label() label.set_text(ylabel) @@ -2711,7 +2717,9 @@ %(Line2D)s - See :meth:`axhspan` for example plot and source code + .. seealso:: + :meth:`axhspan`: + for example plot and source code """ ymin, ymax = self.get_ybound() @@ -2765,7 +2773,9 @@ %(Line2D)s - See :meth:`axhspan` for example plot and source code + .. seealso:: + :meth:`axhspan`: + for example plot and source code """ xmin, xmax = self.get_xbound() @@ -2863,7 +2873,9 @@ %(Polygon)s - See :meth:`axhspan` for example plot and source code + .. seealso:: + :meth:`axhspan`: + for example plot and source code """ # convert x axis units trans = mtransforms.blended_transform_factory( @@ -3166,12 +3178,6 @@ *x* and/or *y* can be a sequence of dates represented as float days since 0001-01-01 UTC. - See :mod:`~matplotlib.dates` for helper functions - :func:`~matplotlib.dates.date2num`, - :func:`~matplotlib.dates.num2date` and - :func:`~matplotlib.dates.drange` for help on creating the - required floating point dates. - Keyword arguments: *fmt*: string @@ -3203,6 +3209,15 @@ %(Line2D)s + .. seealso:: + :mod:`~matplotlib.dates`: + for helper functions + + :func:`~matplotlib.dates.date2num`, + :func:`~matplotlib.dates.num2date` and + :func:`~matplotlib.dates.drange`: + for help on creating the required floating point + dates. """ if not self._hold: self.cla() @@ -3302,7 +3317,9 @@ %(Line2D)s - See :meth:`loglog` for example code and figure + .. seealso:: + :meth:`loglog`: + For example code and figure """ if not self._hold: self.cla() d = {'basex': kwargs.pop( 'basex', 10), @@ -3345,7 +3362,9 @@ %(Line2D)s - See :meth:`loglog` for example code and figure + .. seealso:: + :meth:`loglog`: + For example code and figure """ if not self._hold: self.cla() d = {'basey': kwargs.pop('basey', 10), @@ -3365,7 +3384,7 @@ call signature:: acorr(x, normed=False, detrend=mlab.detrend_none, usevlines=False, - maxlags=None, **kwargs) + maxlags=None, **kwargs) Plot the autocorrelation of *x*. If *normed* = *True*, normalize the data but the autocorrelation at 0-th lag. *x* is @@ -3375,38 +3394,41 @@ Return value is a tuple (*lags*, *c*, *line*) where: - - *lags* are a length 2*maxlags+1 lag vector + - *lags* are a length 2*maxlags+1 lag vector - - *c* is the 2*maxlags+1 auto correlation vector + - *c* is the 2*maxlags+1 auto correlation vector - - *line* is a :class:`~matplotlib.lines.Line2D` instance - returned by :meth:`plot` + - *line* is a :class:`~matplotlib.lines.Line2D` instance + returned by :meth:`plot` The default *linestyle* is None and the default *marker* is ``'o'``, though these can be overridden with keyword args. - The cross correlation is performed with :func:`numpy.correlate` with - *mode* = 2. + The cross correlation is performed with + :func:`numpy.correlate` with *mode* = 2. If *usevlines* is *True*, :meth:`~matplotlib.axes.Axes.vlines` rather than :meth:`~matplotlib.axes.Axes.plot` is used to draw vertical lines from the origin to the acorr. Otherwise, the plot style is determined by the kwargs, which are - :class:`~matplotlib.lines.Line2D` properties. The return - value is a tuple (*lags*, *c*, *linecol*, *b*) where + :class:`~matplotlib.lines.Line2D` properties. + *maxlags* is a positive integer detailing the number of lags + to show. The default value of *None* will return all + :math:`2 \mathrm{len}(x) - 1`` lags. + + The return value is a tuple (*lags*, *c*, *linecol*, *b*) + where + - *linecol* is the :class:`~matplotlib.collections.LineCollection` - *b* is the *x*-axis. - *maxlags* is a positive integer detailing the number of lags - to show. The default value of *None* will return all - ``(2*len(x)-1)`` lags. + .. seealso:: + :meth:`~matplotlib.axes.Axes.plot` or + :meth:`~matplotlib.axes.Axes.vlines`: + For documentation on valid kwargs. - See the respective :meth:`~matplotlib.axes.Axes.plot` or - :meth:`~matplotlib.axes.Axes.vlines` functions for - documentation on valid kwargs. - **Example:** :func:`~matplotlib.pyplot.xcorr` above, and @@ -4095,9 +4117,13 @@ Return value is a tuple (*markerline*, *stemlines*, *baseline*). - See `this document - <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/stem.html>`_ - for details and :file:`examples/pylab_examples/stem_plot.py` for a demo. + .. seealso:: + `this document + <http://www.mathworks.com/access/helpdesk/help/techdoc/ref/stem.html>`_: + for details + + :file:`examples/pylab_examples/stem_plot.py`: + for a demo """ remember_hold=self._hold if not self._hold: self.cla() @@ -5359,8 +5385,6 @@ xs, ys = poly_between(x, 0, y) axes.fill(xs, ys, facecolor='red', alpha=0.5) - See :file:`examples/pylab_examples/fill_between.py` for more examples. - The *closed* kwarg will close the polygon when *True* (default). kwargs control the Polygon properties: @@ -5370,6 +5394,10 @@ **Example:** .. plot:: ../mpl_examples/pylab_examples/fill_demo.py + + .. seealso:: + :file:`examples/pylab_examples/fill_between.py`: + For more examples. """ if not self._hold: self.cla() @@ -5805,15 +5833,16 @@ Return value is a :class:`matplotlib.collection.QuadMesh` object. - See :func:`~matplotlib.pyplot.pcolor` for an explanation of - the grid orientation and the expansion of 1-D *X* and/or *Y* - to 2-D arrays. - kwargs can be used to control the :class:`matplotlib.collections.QuadMesh` properties: %(QuadMesh)s + + .. seealso:: + :func:`~matplotlib.pyplot.pcolor`: + For an explanation of the grid orientation and the + expansion of 1-D *X* and/or *Y* to 2-D arrays. """ if not self._hold: self.cla() @@ -6519,8 +6548,6 @@ to compute :math:`P_{xy}`, with a scaling to correct for power loss due to windowing. - See :meth:`psd` for a description of the optional parameters. - Returns the tuple (*Pxy*, *freqs*). *P* is the cross spectrum (complex valued), and :math:`10\log_{10}|P_{xy}|` is plotted. @@ -6536,6 +6563,10 @@ **Example:** .. plot:: ../mpl_examples/pylab_examples/csd_demo.py + + .. seealso: + :meth:`psd` + For a description of the optional parameters. """ if not self._hold: self.cla() pxy, freqs = mlab.csd(x, y, NFFT, Fs, detrend, window, noverlap) @@ -6576,8 +6607,6 @@ The return value is a tuple (*Cxy*, *f*), where *f* are the frequencies of the coherence vector. - See the :meth:`psd` for a description of the optional parameters. - kwargs are applied to the lines. References: @@ -6593,6 +6622,10 @@ **Example:** .. plot:: ../mpl_examples/pylab_examples/cohere_demo.py + + .. seealso: + :meth:`psd` + For a description of the optional parameters. """ if not self._hold: self.cla() cxy, freqs = mlab.cohere(x, y, NFFT, Fs, detrend, window, noverlap) @@ -6633,9 +6666,6 @@ default 0, max(bins), 0, max(freqs) where bins is the return value from mlab.specgram - See :meth:`~matplotlib.axes.Axes.psd` for information on the - other keyword arguments. - Return value is (*Pxx*, *freqs*, *bins*, *im*): - *bins* are the time points the spectrogram is calculated over @@ -6646,6 +6676,10 @@ Note: If *x* is real (i.e. non-complex), only the positive spectrum is shown. If *x* is complex, both positive and negative parts of the spectrum are shown. + + .. seealso: + :meth:`psd` + For a description of the optional parameters. """ if not self._hold: self.cla() @@ -6709,7 +6743,8 @@ * *cmap* * *alpha* - See documentation for :func:`~matplotlib.pyplot.imshow` for details. + .. seealso:: + :func:`~matplotlib.pyplot.imshow` For controlling colors, e.g. cyan background and red marks, use:: @@ -6722,8 +6757,6 @@ * *markersize* * *color* - See documentation for :func:`~matplotlib.pyplot.plot` for details. - Useful values for *marker* include: * 's' square (default) @@ -6731,6 +6764,8 @@ * '.' point * ',' pixel + .. seealso:: + :func:`~matplotlib.pyplot.plot` """ if precision is None: precision = 0 Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-10-16 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2008-10-16 17:32:39 UTC (rev 6223) @@ -483,11 +483,14 @@ def get_dashes(self): """ - Return the dash information as an offset dashlist tuple The - dash list is a even size list that gives the ink on, ink off - in pixels. See p107 of to postscript `BLUEBOOK + Return the dash information as an offset dashlist tuple. + + The dash list is a even size list that gives the ink on, ink + off in pixels. + + See p107 of to PostScript `BLUEBOOK <http://www-cdf.fnal.gov/offline/PostScript/BLUEBOOK.PDF>`_ - for more info + for more info. Default value is None """ Modified: trunk/matplotlib/lib/matplotlib/collections.py =================================================================== --- trunk/matplotlib/lib/matplotlib/collections.py 2008-10-16 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/collections.py 2008-10-16 17:32:39 UTC (rev 6223) @@ -262,7 +262,9 @@ def set_linestyles(self, ls): """ Set the linestyles(s) for the collection. - ACCEPTS: ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) ] + + ACCEPTS: ['solid' | 'dashed', 'dashdot', 'dotted' | + (offset, on-off-dash-seq) ] """ try: dashd = backend_bases.GraphicsContextBase.dashd @@ -314,9 +316,11 @@ def set_color(self, c): """ Set both the edgecolor and the facecolor. - See :meth:`set_facecolor` and :meth:`set_edgecolor`. ACCEPTS: matplotlib color arg or sequence of rgba tuples + + .. seealso:: + :meth:`set_facecolor`, :meth:`set_edgecolor` """ self.set_facecolor(c) self.set_edgecolor(c) Modified: trunk/matplotlib/lib/matplotlib/colors.py =================================================================== --- trunk/matplotlib/lib/matplotlib/colors.py 2008-10-16 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/colors.py 2008-10-16 17:32:39 UTC (rev 6223) @@ -530,7 +530,9 @@ segmentdata argument is a dictionary with a red, green and blue entries. Each entry should be a list of x, y0, y1 tuples. - See makeMappingArray for details + + .. seealso:: + :func:`makeMappingArray` """ self.monochrome = False # True only if all colors in map are identical; # needed for contouring. Modified: trunk/matplotlib/lib/matplotlib/dates.py =================================================================== --- trunk/matplotlib/lib/matplotlib/dates.py 2008-10-16 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/dates.py 2008-10-16 17:32:39 UTC (rev 6223) @@ -9,9 +9,9 @@ conversion to and from datetime and numeric ranges. A wide range of specific and general purpose date tick locators and -formatters are provided in this module. See matplotlib.tickers for -general information on tick locators and formatters. These are -described below. +formatters are provided in this module. See +:module:`matplotlib.ticker` for general information on tick locators +and formatters. These are described below. All the matplotlib date converters, tickers and formatters are timezone aware, and the default timezone is given by the timezone Modified: trunk/matplotlib/lib/matplotlib/image.py =================================================================== --- trunk/matplotlib/lib/matplotlib/image.py 2008-10-16 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/image.py 2008-10-16 17:32:39 UTC (rev 6223) @@ -330,7 +330,9 @@ """ Set the interpolation method the image uses when resizing. - ACCEPTS: ['bicubic' | 'bilinear' | 'blackman100' | 'blackman256' | 'blackman64', 'nearest' | 'sinc144' | 'sinc256' | 'sinc64' | 'spline16' | 'spline36'] + ACCEPTS: ['bicubic' | 'bilinear' | 'blackman100' | 'blackman256' | + 'blackman64', 'nearest' | 'sinc144' | 'sinc256' | 'sinc64' | + 'spline16' | 'spline36'] """ if s is None: s = rcParams['image.interpolation'] s = s.lower() Modified: trunk/matplotlib/lib/matplotlib/lines.py =================================================================== --- trunk/matplotlib/lib/matplotlib/lines.py 2008-10-16 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/lines.py 2008-10-16 17:32:39 UTC (rev 6223) @@ -299,14 +299,15 @@ def set_pickradius(self,d): """Sets the pick radius used for containment tests - Accepts: float distance in points. + ACCEPTS: float distance in points """ self.pickradius = d def set_picker(self,p): """Sets the event picker details for the line. - Accepts: float distance in points or callable pick function fn(artist,event) + ACCEPTS: float distance in points or callable pick function + ``fn(artist, event)`` """ if callable(p): self._contains = p @@ -330,12 +331,13 @@ self._xcid = ax.xaxis.callbacks.connect('units', self.recache) if ax.yaxis is not None: self._ycid = ax.yaxis.callbacks.connect('units', self.recache) + set_axes.__doc__ = Artist.set_axes.__doc__ def set_data(self, *args): """ Set the x and y data - ACCEPTS: (np.array xdata, np.array ydata) + ACCEPTS: 2D array """ if len(args)==1: x, y = args[0] @@ -401,7 +403,7 @@ """ set the Transformation instance used by this artist - ACCEPTS: a matplotlib.transforms.Transform instance + ACCEPTS: a :class:`matplotlib.transforms.Transform` instance """ Artist.set_transform(self, t) self._invalid = True @@ -673,7 +675,7 @@ """ Set the data np.array for x - ACCEPTS: np.array + ACCEPTS: 1D array """ x = np.asarray(x) self.set_data(x, self._yorig) @@ -682,7 +684,7 @@ """ Set the data np.array for y - ACCEPTS: np.array + ACCEPTS: 1D array """ y = np.asarray(y) self.set_data(self._xorig, y) Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-10-16 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-10-16 17:32:39 UTC (rev 6223) @@ -60,8 +60,8 @@ USAGE: - See http://matplotlib.sourceforge.net/tutorial.html#mathtext for a - tutorial introduction. + See http://matplotlib.sf.net/users/mathtext.html for a tutorial + introduction. Any text element (xlabel, ylabel, title, text, etc) can use TeX markup, as in Modified: trunk/matplotlib/lib/matplotlib/mlab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mlab.py 2008-10-16 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/mlab.py 2008-10-16 17:32:39 UTC (rev 6223) @@ -330,21 +330,25 @@ window vectors see numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window etc. - See psd for more info. (psd differs in the default overlap; - in returning the mean of the segment periodograms; and in not - returning times.) + If *x* is real (i.e. non-complex) only the positive spectrum is + given. If *x* is complex then the complete spectrum is given. - If x is real (i.e. non-Complex) only the positive spectrum is - given. If x is Complex then the complete spectrum is given. + Returns a tuple (*Pxx*, *freqs*, *t*): - returns: - Pxx - 2-D array, columns are the periodograms of - successive segments - freqs - 1-D array of frequencies corresponding to - the rows in Pxx - t - 1-D array of times corresponding to midpoints of - segments. + - *Pxx*: 2-D array, columns are the periodograms of + successive segments + - *freqs*: 1-D array of frequencies corresponding to the rows + in Pxx + + - *t*: 1-D array of times corresponding to midpoints of + segments. + + .. seealso:: + :func:`psd`: + :func:`psd` differs in the default overlap; in returning + the mean of the segment periodograms; and in not returning + times. """ x = np.asarray(x) assert(NFFT>noverlap) @@ -407,15 +411,19 @@ The coherence between x and y. Coherence is the normalized cross spectral density - Cxy = |Pxy|^2/(Pxx*Pyy) + .. math:: - The return value is (Cxy, f), where f are the frequencies of the - coherence vector. See the docs for psd and csd for information - about the function arguments NFFT, detrend, window, noverlap, as - well as the methods used to compute Pxy, Pxx and Pyy. + C_{xy} = \frac{|P_{xy}|^2}/{P_{xx}P_{yy}} - Returns the tuple Cxy, freqs + The return value is the tuple (*Cxy*, *f*), where *f* are the + frequencies of the coherence vector. + .. seealso:: + :func:`psd` and :func:`csd`: + For information about the function arguments *NFFT*, + *detrend*, *window*, *noverlap*, as well as the methods + used to compute :math:`P_{xy}`, :math:`P_{xx}` and + :math:`P_{yy}`. """ if len(x)<2*NFFT: @@ -483,8 +491,8 @@ but note that the k's and n's in the superscripts and subscripts on that page. The linear algebra is correct, however. - See also polyval - + .. seealso:: + :func:`polyval` """ warnings.warn("use numpy.poyfit", DeprecationWarning) return np.polyfit(*args, **kwargs) @@ -505,8 +513,8 @@ trend = polyval(p, x) resid = y - trend - See also polyfit - + .. seealso:: + :func:`polyfit` """ warnings.warn("use numpy.polyval", DeprecationWarning) return np.polyval(*args, **kwargs) @@ -590,10 +598,11 @@ 10x faster than naievly crunching all possible pairs through cohere. - See test/cohere_pairs_test.py in the src tree for an example - script that shows that this cohere_pairs and cohere give the same - results for a given pair. - + .. seealso:: + :file:`test/cohere_pairs_test.py` in the src tree: + For an example script that shows that this + :func:`cohere_pairs` and :func:`cohere` give the same + results for a given pair. """ numRows, numCols = X.shape @@ -1062,13 +1071,22 @@ def liaupunov(x, fprime): """ - x is a very long trajectory from a map, and fprime returns the - derivative of x. Return lambda = 1/n\sum ln|fprime(x_i)|. See Sec - 10.5 Strogatz (1994)"Nonlinear Dynamics and Chaos". - See also http://en.wikipedia.org/wiki/Lyapunov_exponent. - What the function here calculates may not be what you really want; - caveat emptor. - It also seems that this function's name is badly misspelled. + *x* is a very long trajectory from a map, and *fprime* returns the + derivative of *x*. + + Returns :math:`\lambda = \frac{1}{n}\sum \ln|f^'(x_i)|` + + .. seealso:: + Sec 10.5 Strogatz (1994) "Nonlinear Dynamics and Chaos". + + `Wikipedia article on Lyapunov Exponent + http://en.wikipedia.org/wiki/Lyapunov_exponent`_. + + .. note:: + What the function here calculates may not be what you really want; + *caveat emptor*. + + It also seems that this function's name is badly misspelled. """ return np.mean(np.log(np.absolute(fprime(x)))) @@ -1252,7 +1270,9 @@ dtype, the array will have this dtype. default: numpy.float_ - See examples/load_demo.py which exeercises many of these options. + .. seealso:: + See :file:`examples/load_demo.py` in the source tree: + Exercises many of these options. """ if converters is None: converters = {} @@ -2393,9 +2413,10 @@ fname - can be a filename or a file handle. Support for gzipped files is automatic, if the filename ends in .gz - See csv2rec and rec2csv for information about missing and - missingd, which can be used to fill in masked values into your CSV - file. + .. seealso:: + :func:`csv2rec` and :func:`rec2csv`: + For information about *missing* and *missingd*, which can + be used to fill in masked values into your CSV file. """ if missingd is None: Modified: trunk/matplotlib/lib/matplotlib/patches.py =================================================================== --- trunk/matplotlib/lib/matplotlib/patches.py 2008-10-16 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/patches.py 2008-10-16 17:32:39 UTC (rev 6223) @@ -51,39 +51,6 @@ def __str__(self): return str(self.__class__).split('.')[-1] - def __init__(self, - edgecolor=None, - facecolor=None, - linewidth=None, - linestyle=None, - antialiased = None, - hatch = None, - fill=True, - **kwargs - ): - """ - The following kwarg properties are supported - %(Patch)s - """ - artist.Artist.__init__(self) - - if linewidth is None: linewidth = mpl.rcParams['patch.linewidth'] - if linestyle is None: linestyle = "solid" - if antialiased is None: antialiased = mpl.rcParams['patch.antialiased'] - - self.set_edgecolor(edgecolor) - self.set_facecolor(facecolor) - self.set_linewidth(linewidth) - self.set_linestyle(linestyle) - self.set_antialiased(antialiased) - self.set_hatch(hatch) - self.fill = fill - self._combined_transform = transforms.IdentityTransform() - - if len(kwargs): artist.setp(self, **kwargs) - __init__.__doc__ = cbook.dedent(__init__.__doc__) % artist.kwdocd - - def get_verts(self): """ Return a copy of the vertices used in this patch @@ -176,8 +143,11 @@ """ if color is None: color = mpl.rcParams['patch.edgecolor'] self._edgecolor = color - set_ec = set_edgecolor + def set_ec(self, color): + """alias for set_edgecolor""" + return self.set_edgecolor(color) + def set_facecolor(self, color): """ Set the patch face color @@ -186,8 +156,11 @@ """ if color is None: color = mpl.rcParams['patch.facecolor'] self._facecolor = color - set_fc = set_facecolor + def set_fc(self, color): + """alias for set_facecolor""" + return self.set_facecolor(color) + def set_linewidth(self, w): """ Set the patch linewidth in points @@ -196,8 +169,11 @@ """ if w is None: w = mpl.rcParams['patch.linewidth'] self._linewidth = w - set_lw = set_linewidth + def set_lw(self, lw): + """alias for set_linewidth""" + return self.set_linewidth(lw) + def set_linestyle(self, ls): """ Set the patch linestyle @@ -206,8 +182,11 @@ """ if ls is None: ls = "solid" self._linestyle = ls - set_ls = set_linestyle + def set_ls(self, ls): + """alias for set_linestyle""" + return self.set_linestyle(ls) + def set_fill(self, b): """ Set whether to fill the patch @@ -297,7 +276,49 @@ def get_window_extent(self, renderer=None): return self.get_path().get_extents(self.get_transform()) +artist.kwdocd['Patch'] = patchdoc = artist.kwdoc(Patch) +for k in ('Rectangle', 'Circle', 'RegularPolygon', 'Polygon', 'Wedge', 'Arrow', + 'FancyArrow', 'YAArrow', 'CirclePolygon', 'Ellipse', 'Arc', + 'FancyBboxPatch'): + artist.kwdocd[k] = patchdoc +# define Patch.__init__ after the class so that the docstring can be +# auto-generated. +def __patch__init__(self, + edgecolor=None, + facecolor=None, + linewidth=None, + linestyle=None, + antialiased = None, + hatch = None, + fill=True, + **kwargs + ): + """ + The following kwarg properties are supported + + %(Patch)s + """ + artist.Artist.__init__(self) + + if linewidth is None: linewidth = mpl.rcParams['patch.linewidth'] + if linestyle is None: linestyle = "solid" + if antialiased is None: antialiased = mpl.rcParams['patch.antialiased'] + + self.set_edgecolor(edgecolor) + self.set_facecolor(facecolor) + self.set_linewidth(linewidth) + self.set_linestyle(linestyle) + self.set_antialiased(antialiased) + self.set_hatch(hatch) + self.fill = fill + self._combined_transform = transforms.IdentityTransform() + + if len(kwargs): artist.setp(self, **kwargs) + +__patch__init__.__doc__ = cbook.dedent(__patch__init__.__doc__) % artist.kwdocd +Patch.__init__ = __patch__init__ + class Shadow(Patch): def __str__(self): return "Shadow(%s)"%(str(self.patch)) @@ -571,7 +592,10 @@ Valid kwargs are: %(Patch)s - See Patch documentation for additional kwargs + + .. seealso:: + :class:`Patch`: + For additional kwargs """ Patch.__init__(self, **kwargs) self._path = path @@ -596,7 +620,10 @@ Valid kwargs are: %(Patch)s - See Patch documentation for additional kwargs + + .. seealso:: + :class:`Patch`: + For additional kwargs """ Patch.__init__(self, **kwargs) xy = np.asarray(xy, np.float_) @@ -1019,7 +1046,7 @@ can not be filled. The arc must be used in an :class:`~matplotlib.axes.Axes` - instance---it cannot be added directly to a + instance---it can not be added directly to a :class:`~matplotlib.figure.Figure`---because it is optimized to only render the segments that are inside the axes bounding box with high resolution. @@ -1266,17 +1293,7 @@ r.set_clip_on( False ) r.draw(renderer) -artist.kwdocd['Patch'] = patchdoc = artist.kwdoc(Patch) -for k in ('Rectangle', 'Circle', 'RegularPolygon', 'Polygon', 'Wedge', 'Arrow', - 'FancyArrow', 'YAArrow', 'CirclePolygon', 'Ellipse', 'Arc'): - artist.kwdocd[k] = patchdoc - - - - - - class BboxTransmuterBase(object): """ Bbox Transmuter Base class @@ -1284,7 +1301,7 @@ BBoxTransmuterBase and its derivatives are used to make a fancy box around a given rectangle. The __call__ method returns the Path of the fancy box. This class is not an artist and actual drawing of the - fancy box is done by the FancyBboxPatch class. + fancy box is done by the :class:`FancyBboxPatch` class. """ @@ -1428,7 +1445,7 @@ def _list_available_boxstyles(transmuters): - """ a helper function of the FancyBboxPatch to list the available + """ a helper function of the :class:`FancyBboxPatch` to list the available box styles. It inspects the arguments of the __init__ methods of each classes and report them """ @@ -1450,18 +1467,23 @@ Draw a fancy box around a rectangle with lower left at *xy*=(*x*, *y*) with specified width and height. - FancyBboxPatch class is similar to Rectangle class, but it draws a - fancy box around the rectangle. The transfomation of the rectangle - box to the fancy box is delgated to the BoxTransmuterBase and its - derived classes. The "boxstyle" argument determins what kind of - fancy box will be drawn. In other words, it selects the - BboxTransmuter class to use, and sets optional attributes. A - custom BboxTransmuter can be used with bbox_transmuter argument - (should be an instance, not a class). mutation_scale determines - the overall size of the mutation (by which I mean the - transformation of the rectangle to the fancy path) and the - mutation_aspect determines the aspect-ratio of the mutation. + :class:`FancyBboxPatch` class is similar to :class:`Rectangle` + class, but it draws a fancy box around the rectangle. The + transformation of the rectangle box to the fancy box is delegated + to the :class:`BoxTransmuterBase` and its derived classes. + *boxstyle* determines what kind of fancy box will be drawn. In + other words, it selects the :class:`BboxTransmuter` class to use, + and sets optional attributes. + + *bbox_transmuter* can specify a custom :class:`BboxTransmuter` + instance. + + *mutation_scale* determines the overall size of the mutation (by + which I mean the transformation of the rectangle to the fancy + path) + + *mutation_aspect* determines the aspect-ratio of the mutation. """ _fancy_bbox_transmuters = {"square":SquareBoxTransmuter, @@ -1482,7 +1504,7 @@ *xy*=lower left corner *width*, *height* - The *boxstyle* describes how the fancy box will be drawn. It + *boxstyle* describes how the fancy box will be drawn. It should be one of the available boxstyle names, with optional comma-separated attributes. These attributes are meant to be scaled with the *mutation_scale*. Following box styles are @@ -1490,16 +1512,16 @@ %(AvailableBoxstyles)s - The boxstyle name can be "custom", in which case the - bbox_transmuter needs to be set, which should be an instance - of BboxTransmuterBase (or its derived). + The *boxstyle* name can be "custom", in which case the + *bbox_transmuter* argument needs to be set, which should be an + instance of :class:`BboxTransmuterBase` (or its derived). *mutation_scale* : a value with which attributes of boxstyle - (e.g., pad) will be scaled. default=1. + (e.g., pad) will be scaled. default=1. *mutation_aspect* : The height of the rectangle will be - squeezed by this value before the mutation and the mutated - box will be stretched by the inverse of it. default=None. + squeezed by this value before the mutation and the mutated + box will be stretched by the inverse of it. default=None. Valid kwargs are: %(Patch)s @@ -1539,16 +1561,18 @@ Set the box style. *boxstyle* can be a string with boxstyle name with optional - comma-separated attributes. Alternatively, the attrs can - be probided as kewords. + comma-separated attributes. Alternatively, the attrs can + be provided as keywords:: set_boxstyle("round,pad=0.2") set_boxstyle("round", pad=0.2) - Olf attrs simply are forgotten. + Old attrs simply are forgotten. - Without argument (or with boxstyle=None), it prints out + Without argument (or with *boxstyle* = None), it prints out available box styles. + + ACCEPTS: [ %(AvailableBoxstyles)s ] """ if boxstyle==None: @@ -1573,8 +1597,13 @@ boxstyle_args.update(kw) self._bbox_transmuter = bbox_transmuter_cls(**boxstyle_args) + kwdoc = dict() + kwdoc["AvailableBoxstyles"]=" | ".join([l \ + for l in _list_available_boxstyles(_fancy_bbox_transmuters)]) + kwdoc.update(artist.kwdocd) + set_boxstyle.__doc__ = set_boxstyle.__doc__ % kwdoc + del kwdoc - def set_mutation_scale(self, scale): """ Set the mutation scale. Modified: trunk/matplotlib/lib/matplotlib/path.py =================================================================== --- trunk/matplotlib/lib/matplotlib/path.py 2008-10-16 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/path.py 2008-10-16 17:32:39 UTC (rev 6223) @@ -217,9 +217,10 @@ """ Return a transformed copy of the path. - See :class:`matplotlib.transforms.TransformedPath` for a path - that will cache the transformed result and automatically - update when the transform changes. + .. seealso:: + :class:`matplotlib.transforms.TransformedPath`: + A path class that will cache the transformed result + and automatically update when the transform changes. """ return Path(transform.transform(self.vertices), self.codes) Modified: trunk/matplotlib/lib/matplotlib/pyplot.py =================================================================== --- trunk/matplotlib/lib/matplotlib/pyplot.py 2008-10-16 17:23:18 UTC (rev 6222) +++ trunk/matplotlib/lib/matplotlib/pyplot.py 2008-10-16 17:32:39 UTC (rev 6223) @@ -416,16 +416,17 @@ can be a string or an integer specifying the legend location + A :class:`matplotlib.legend.Legend` instance is returned. + Example:: figlegend( (line1, line2, line3), ('label1', 'label2', 'label3'), 'upper right' ) - See :func:`~matplotlib.pyplot.legend` for information about the - location codes - - A :class:`matplotlib.legend.Legend` instance is returned. + .. seealso:: + :func:`~matplotlib.pyplot.legend`: + For information about the location codes """ l = gcf().legend(handles, labels, loc, **kwargs) draw_if_interactive() @@ -592,9 +593,6 @@ subplot(211, axisbg='y') - See :func:`~matplotlib.pyplot.axes` for additional information on - :func:`axes` and :func:`subplot` keyword arguments. - New subplots that overlap old will delete the old axes. If you do not want this behavior, use :meth:`matplotlib.figure.Figure.add_subplot` or the @@ -605,6 +603,10 @@ subplot(211) # overlaps, subplot(111) is killed plot(rand(12), rand(12)) + .. seealso:: + :func:`~matplotlib.pyplot.axes`: + For additional information on :func:`axes` and + :func:`subplot` keyword arguments. """ @@ -628,7 +630,8 @@ *None*) sharing the xaxis. The ticks for *ax2* will be placed on the right, and the *ax2* instance is returned. - See :file:`examples/pylab_examples/two_scales.py` + .. seealso:: + :file:`examples/pylab_examples/two_scales.py` """ if ax is None: ax=gca() @@ -721,8 +724,9 @@ 'verticalalignment': 'bottom', 'horizontalalignment': 'center'} - See the :func:`~matplotlib.pyplot.text` docstring for information - of how override and the optional args work. + .. seealso:: + :func:`~matplotlib.pyplot.text`: + for information on how override and the optional args work. """ l = gca().set_title(s, *args, **kwargs) draw_if_interactive() @@ -782,10 +786,12 @@ if ``len(*v)==0``, you can pass in *xmin*, *xmax*, *ymin*, *ymax* as kwargs selectively to alter just those limits without changing - the others. See :func:`xlim` and :func:`ylim` for more information + the others. The xmin, xmax, ymin, ymax tuple is returned + .. seealso:: + :func:`xlim`, :func:`ylim` """ ax = gca() v = ax.axis(*v, **kwargs) @@ -804,9 +810,9 @@ 'horizontalalignment' : 'center' } - See :func:`~matplotlib.pyplot.text` for information of how - override and the optional args work - + .. seealso:: + :func:`~matplotlib.pyplot.text`: + For information on how override and the optional args work """ l = gca().set_xlabel(s, *args, **kwargs) draw_if_interactive() @@ -824,9 +830,10 @@ 'horizontalalignment' : 'right', 'rotation'='vertical' : } - See :func:`~matplotlib.pyplot.text` for information on how - override and the optional args work. - + .. seealso:: + :func:`~matplotlib.pyplot.text`: + For information on how override and the optional args + work. """ l = gca().set_ylabel(s, *args, **kwargs) draw_if_interactive() @@ -2430,7 +2437,9 @@ def autumn(): ''' Set the default colormap to *autumn* and apply to current image if any. - See :func:`colormaps` for more information. + + .. seealso:: + :func:`colormaps` ''' rc('image', cmap='autumn') im = gci() @@ -2445,7 +2454,9 @@ def bone(): ''' Set the default colormap to bone and apply to current image if any. - See :func:`colormaps` for more information. + + .. seealso:: + :func:`colormaps` ''' rc('image', cmap='bone') im = gci() @@ -2460,7 +2471,9 @@ def cool(): ''' Set the default colormap to cool and apply to current image if any. - See :func:`colormaps` for more information. + + .. seealso:: + :func:`colormaps` ''' rc('image', cmap='cool') im = gci() @@ -2475,7 +2488,9 @@ def copper(): ''' Set the default colormap to copper and apply to current image if any. - See :func:`colormaps` for more information. + + .. seealso:: + :func:`colormaps` ''' rc('image', cmap='copper') im = gci() @@ -2490,7 +2505,9 @@ def flag(): ''' Set the default colormap to flag and apply to current image if any. - See :func:`colormaps` for more information. + + .. seealso:: + :func:`colormaps` ''' rc('image', cmap='flag') im = gci() @@ -2505,7 +2522,9 @@ def gray(): ''' Set the default colormap to gray and apply to current image if any. - See :func:`colormaps` for more information. + + .. seealso:: + :func:`colormaps` ''' rc('image', cmap='gray') im = gci() @@ -2520,7 +2539,9 @@ def hot(): ''' Set the default colormap to hot and apply to current image if any. - See :func:`colormaps` for more information. + + .. seealso:: + :func:`colormaps` ''' rc('image', cm... [truncated message content] |