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

Skip to content

Commit dbad2d1

Browse files
timhoffmstory645
andcommitted
Improve matplotlib.axes documentation
- Move the Axes class documentation to a sub-page. The constructor is quite lengthy and not needed by most users. - Add an introductory sentence to set the context for the subsequent listing and structure of the Axes methods. Note: I've removed the inheritance diagram, because it does not contain much relevant information. The inheritance from _AxesBase is shown in the class docstring as well. The only additional information is that it originally inherits from Artist, which I've now included as a sentence in the docstring. Co-authored-by: hannah <[email protected]>
1 parent ecf6e26 commit dbad2d1

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

doc/api/axes_api.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
``matplotlib.axes``
33
*******************
44

5+
The `~.axes.Axes` class represents one (sub-)plot in a figure. It contains the
6+
plotted, data axis ticks, labels, title, legend, etc. Its methods are the main
7+
interface for manipulating the plot.
8+
59
.. currentmodule:: matplotlib.axes
610

711
.. contents:: Table of Contents
@@ -14,18 +18,15 @@
1418
:no-members:
1519
:no-undoc-members:
1620

17-
Inheritance
18-
===========
19-
.. inheritance-diagram:: matplotlib.axes.Axes
20-
:private-bases:
21-
2221
The Axes class
2322
==============
2423

25-
.. autoclass:: Axes
26-
:no-members:
27-
:no-undoc-members:
28-
:show-inheritance:
24+
.. autosummary::
25+
:toctree: _as_gen
26+
:template: autosummary.rst
27+
:nosignatures:
28+
29+
Axes
2930

3031
Plotting
3132
========

lib/matplotlib/axes/_axes.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,15 @@
4646
@_docstring.interpd
4747
class Axes(_AxesBase):
4848
"""
49-
The `Axes` contains most of the figure elements: `~.axis.Axis`,
49+
An Axes object encapsulates all the elements of an individual (sub-)plot in
50+
a figure.
51+
52+
It contains most of the (sub-)plot elements: `~.axis.Axis`,
5053
`~.axis.Tick`, `~.lines.Line2D`, `~.text.Text`, `~.patches.Polygon`, etc.,
5154
and sets the coordinate system.
5255
56+
Like all visible elements in a figure, Axes is an `.Artist` subclass.
57+
5358
The `Axes` instance supports callbacks through a callbacks attribute which
5459
is a `~.cbook.CallbackRegistry` instance. The events you can connect to
5560
are 'xlim_changed' and 'ylim_changed' and the callback will be called with

0 commit comments

Comments
 (0)