Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c3c1a2c

Browse files
committed
Fix Figure.add_axes docstring formatting bugs.
svn path=/trunk/matplotlib/; revision=5695
1 parent 68e4f80 commit c3c1a2c

1 file changed

Lines changed: 20 additions & 15 deletions

File tree

lib/matplotlib/figure.py

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -636,13 +636,15 @@ def fixlist(args):
636636

637637
def add_axes(self, *args, **kwargs):
638638
"""
639-
Add an a axes with axes rect [left, bottom, width, height] where all
640-
quantities are in fractions of figure width and height. kwargs are
641-
legal Axes kwargs plus "projection" which sets the projection type
642-
of the axes. (For backward compatibility, *polar=True* may also be
643-
provided, which is equivalent to *projection='polar'*).
644-
Valid values for "projection" are: %s. Some of these projections
645-
support additional kwargs, which may be provided to add_axes::
639+
Add an a axes with axes rect [*left*, *bottom*, *width*,
640+
*height*] where all quantities are in fractions of figure
641+
width and height. kwargs are legal
642+
:class:`~matplotlib.axes.Axes` kwargs plus *projection* which
643+
sets the projection type of the axes. (For backward
644+
compatibility, ``polar=True`` may also be provided, which is
645+
equivalent to ``projection='polar'``). Valid values for
646+
*projection* are: %s. Some of these projections support
647+
additional kwargs, which may be provided to :meth:`add_axes`::
646648
647649
rect = l,b,w,h
648650
fig.add_axes(rect)
@@ -651,22 +653,24 @@ def add_axes(self, *args, **kwargs):
651653
fig.add_axes(rect, projection='polar')
652654
fig.add_axes(ax) # add an Axes instance
653655
654-
If the figure already has an axes with key *args, *kwargs then it will
655-
simply make that axes current and return it. If you do not want this
656-
behavior, eg you want to force the creation of a new axes, you must
657-
use a unique set of args and kwargs. The artist "label" attribute has
658-
been exposed for this purpose. Eg, if you want two axes that are
659-
otherwise identical to be added to the figure, make sure you give them
660-
unique labels::
656+
If the figure already has an axes with the same parameters,
657+
then it will simply make that axes current and return it. If
658+
you do not want this behavior, eg. you want to force the
659+
creation of a new axes, you must use a unique set of args and
660+
kwargs. The axes :attr:`~matplotlib.axes.Axes.label`
661+
attribute has been exposed for this purpose. Eg., if you want
662+
two axes that are otherwise identical to be added to the
663+
figure, make sure you give them unique labels::
661664
662665
fig.add_axes(rect, label='axes1')
663666
fig.add_axes(rect, label='axes2')
664667
665668
The :class:`~matplotlib.axes.Axes` instance will be returned.
666669
667670
The following kwargs are supported:
671+
668672
%s
669-
""" % (", ".join(get_projection_names()), '%(Axes)s')
673+
"""
670674

671675
key = self._make_key(*args, **kwargs)
672676

@@ -699,6 +703,7 @@ def add_axes(self, *args, **kwargs):
699703
self._seen[key] = a
700704
return a
701705

706+
add_axes.__doc__ = add_axes.__doc__ % (", ".join(get_projection_names()), '%(Axes)s')
702707
add_axes.__doc__ = dedent(add_axes.__doc__) % artist.kwdocd
703708

704709
def add_subplot(self, *args, **kwargs):

0 commit comments

Comments
 (0)