Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5a22c8b

Browse filesBrowse files
authored
Merge pull request #11459 from fredrik-1/doc_subplot_axes
Doc changes in add_subplot and add_axes
2 parents 2474b37 + dbc4290 commit 5a22c8b
Copy full SHA for 5a22c8b

File tree

Expand file treeCollapse file tree

4 files changed

+421
-225
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+421
-225
lines changed

‎lib/matplotlib/axes/_base.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_base.py
+24-46Lines changed: 24 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,6 @@ def __str__(self):
408408
return "{0}({1[0]:g},{1[1]:g};{1[2]:g}x{1[3]:g})".format(
409409
type(self).__name__, self._position.bounds)
410410

411-
@docstring.Substitution(scale=' | '.join(
412-
[repr(x) for x in mscale.get_scale_names()]))
413411
def __init__(self, fig, rect,
414412
facecolor=None, # defaults to rc axes.facecolor
415413
frameon=True,
@@ -421,52 +419,32 @@ def __init__(self, fig, rect,
421419
**kwargs
422420
):
423421
"""
424-
Build an `~axes.Axes` instance in
425-
`~matplotlib.figure.Figure` *fig* with
426-
*rect=[left, bottom, width, height]* in
427-
`~matplotlib.figure.Figure` coordinates
422+
Build an axes in a figure.
428423
429-
Optional keyword arguments:
424+
Parameters
425+
----------
426+
fig : `~matplotlib.figure.Figure`
427+
The axes is build in the `.Figure` *fig*.
428+
429+
rect : [left, bottom, width, height]
430+
The axes is build in the rectangle *rect*. *rect* is in
431+
`.Figure` coordinates.
432+
433+
sharex, sharey : `~.axes.Axes`, optional
434+
The x or y `~.matplotlib.axis` is shared with the x or
435+
y axis in the input `~.axes.Axes`.
430436
431-
================ =========================================
432-
Keyword Description
433-
================ =========================================
434-
*adjustable* [ 'box' | 'datalim' ]
435-
*alpha* float: the alpha transparency (can be None)
436-
*anchor* [ 'C', 'SW', 'S', 'SE', 'E', 'NE', 'N',
437-
'NW', 'W' ]
438-
*aspect* [ 'auto' | 'equal' | aspect_ratio ]
439-
*autoscale_on* bool; whether to autoscale the *viewlim*
440-
*axisbelow* [ bool | 'line' ] draw the grids
441-
and ticks below or above most other artists,
442-
or below lines but above patches
443-
*cursor_props* a (*float*, *color*) tuple
444-
*figure* a :class:`~matplotlib.figure.Figure`
445-
instance
446-
*frame_on* bool; whether to draw the axes frame
447-
*label* the axes label
448-
*navigate* bool
449-
*navigate_mode* [ 'PAN' | 'ZOOM' | None ] the navigation
450-
toolbar button status
451-
*position* [left, bottom, width, height] in
452-
class:`~matplotlib.figure.Figure` coords
453-
*sharex* an class:`~matplotlib.axes.Axes` instance
454-
to share the x-axis with
455-
*sharey* an class:`~matplotlib.axes.Axes` instance
456-
to share the y-axis with
457-
*title* the title string
458-
*visible* bool, whether the axes is visible
459-
*xlabel* the xlabel
460-
*xlim* (*xmin*, *xmax*) view limits
461-
*xscale* [%(scale)s]
462-
*xticklabels* sequence of strings
463-
*xticks* sequence of floats
464-
*ylabel* the ylabel strings
465-
*ylim* (*ymin*, *ymax*) view limits
466-
*yscale* [%(scale)s]
467-
*yticklabels* sequence of strings
468-
*yticks* sequence of floats
469-
================ =========================================
437+
frameon : bool, optional
438+
True means that the axes frame is visible.
439+
440+
**kwargs
441+
Other optional keyword arguments:
442+
%(Axes)s
443+
444+
Returns
445+
-------
446+
axes : `~.axes.Axes`
447+
The new `~.axes.Axes` object.
470448
"""
471449

472450
martist.Artist.__init__(self)

‎lib/matplotlib/axes/_subplots.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_subplots.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,4 +215,6 @@ def _picklable_subplot_class_constructor(axes_class):
215215

216216

217217
docstring.interpd.update(Axes=martist.kwdoc(Axes))
218+
docstring.dedent_interpd(Axes.__init__)
219+
218220
docstring.interpd.update(Subplot=martist.kwdoc(Axes))

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.