Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc changes in add_subplot and add_axes #11459

Merged
merged 1 commit into from Jun 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
70 changes: 24 additions & 46 deletions lib/matplotlib/axes/_base.py
Expand Up @@ -408,8 +408,6 @@ def __str__(self):
return "{0}({1[0]:g},{1[1]:g};{1[2]:g}x{1[3]:g})".format(
type(self).__name__, self._position.bounds)

@docstring.Substitution(scale=' | '.join(
[repr(x) for x in mscale.get_scale_names()]))
def __init__(self, fig, rect,
facecolor=None, # defaults to rc axes.facecolor
frameon=True,
Expand All @@ -421,52 +419,32 @@ def __init__(self, fig, rect,
**kwargs
):
"""
Build an `~axes.Axes` instance in
`~matplotlib.figure.Figure` *fig* with
*rect=[left, bottom, width, height]* in
`~matplotlib.figure.Figure` coordinates
Build an axes in a figure.

Optional keyword arguments:
Parameters
----------
fig : `~matplotlib.figure.Figure`
The axes is build in the `.Figure` *fig*.

rect : [left, bottom, width, height]
The axes is build in the rectangle *rect*. *rect* is in
`.Figure` coordinates.

sharex, sharey : `~.axes.Axes`, optional
The x or y `~.matplotlib.axis` is shared with the x or
y axis in the input `~.axes.Axes`.

================ =========================================
Keyword Description
================ =========================================
*adjustable* [ 'box' | 'datalim' ]
*alpha* float: the alpha transparency (can be None)
*anchor* [ 'C', 'SW', 'S', 'SE', 'E', 'NE', 'N',
'NW', 'W' ]
*aspect* [ 'auto' | 'equal' | aspect_ratio ]
*autoscale_on* bool; whether to autoscale the *viewlim*
*axisbelow* [ bool | 'line' ] draw the grids
and ticks below or above most other artists,
or below lines but above patches
*cursor_props* a (*float*, *color*) tuple
*figure* a :class:`~matplotlib.figure.Figure`
instance
*frame_on* bool; whether to draw the axes frame
*label* the axes label
*navigate* bool
*navigate_mode* [ 'PAN' | 'ZOOM' | None ] the navigation
toolbar button status
*position* [left, bottom, width, height] in
class:`~matplotlib.figure.Figure` coords
*sharex* an class:`~matplotlib.axes.Axes` instance
to share the x-axis with
*sharey* an class:`~matplotlib.axes.Axes` instance
to share the y-axis with
*title* the title string
*visible* bool, whether the axes is visible
*xlabel* the xlabel
*xlim* (*xmin*, *xmax*) view limits
*xscale* [%(scale)s]
*xticklabels* sequence of strings
*xticks* sequence of floats
*ylabel* the ylabel strings
*ylim* (*ymin*, *ymax*) view limits
*yscale* [%(scale)s]
*yticklabels* sequence of strings
*yticks* sequence of floats
================ =========================================
frameon : bool, optional
True means that the axes frame is visible.

**kwargs
Other optional keyword arguments:
%(Axes)s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recall that we had decided to move away from docstring interpolation a couple of years ago. I may be wrong, so ignore this (although it would be good to investigate and document this if it is the case).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know but I suggested to avoid those in another thread some weeks ago but it got turned down (and I have also kind of changed opinion).


Returns
-------
axes : `~.axes.Axes`
The new `~.axes.Axes` object.
"""

martist.Artist.__init__(self)
Expand Down
2 changes: 2 additions & 0 deletions lib/matplotlib/axes/_subplots.py
Expand Up @@ -215,4 +215,6 @@ def _picklable_subplot_class_constructor(axes_class):


docstring.interpd.update(Axes=martist.kwdoc(Axes))
docstring.dedent_interpd(Axes.__init__)

docstring.interpd.update(Subplot=martist.kwdoc(Axes))