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

Skip to content

Commit f410859

Browse files
resurrect axes_grid1 doc
1 parent 304154c commit f410859

File tree

24 files changed

+189
-135
lines changed

24 files changed

+189
-135
lines changed

doc/_templates/automodule.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{{ fullname | escape | underline}}
22

3+
{% if fullname in ['mpl_toolkits.axes_grid1.colorbar'] %}
4+
.. To prevent problems with the autosummary for the colorbar doc
5+
treat this separately (sphinx-doc/sphinx/issues/4874)
6+
.. automodule:: {{ fullname }}
7+
:members:
8+
9+
{% else %}
310

411
.. automodule:: {{ fullname }}
512
:no-members:
@@ -33,3 +40,4 @@ Functions
3340
{{ item }}{% endif %}{% endfor %}
3441
{% endif %}
3542
{% endblock %}
43+
{% endif %}

doc/_templates/autosummary.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@
66
.. auto{{ objtype }}:: {{ objname }}
77
88
{% if objtype in ['class', 'method', 'function'] %}
9-
9+
{% if objname in ['AxesGrid', 'Scalable', 'HostAxes', 'FloatingAxes',
10+
'ParasiteAxesAuxTrans', 'ParasiteAxes'] %}
11+
.. Filter out the above aliases to other classes, as sphinx gallery
12+
creates no example file for those (sphinx-gallery/sphinx-gallery#365)
13+
14+
{% else %}
1015
.. include:: {{module}}.{{objname}}.examples
1116

1217
.. raw:: html
1318

1419
<div class="clearer"></div>
1520

21+
{% endif %}
1622
{% endif %}

doc/api/api_changes.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Changed function signatures
6262
kwarg ``fig`` to `.GridSpec.get_subplot_params` is
6363
deprecated, use ``figure`` instead.
6464

65-
Using `.pyplot.axes` with an `.Axes` as argument is deprecated. This sets
65+
Using `.pyplot.axes` with an `~matplotlib.axes.Axes` as argument is deprecated. This sets
6666
the current axes, i.e. it has the same effect as `.pyplot.sca`. For clarity
6767
``plt.sca(ax)`` should be preferred over ``plt.axes(ax)``.
6868

@@ -848,7 +848,7 @@ Deprecation and removal
848848

849849
Color of Axes
850850
~~~~~~~~~~~~~
851-
The ``axisbg`` and ``axis_bgcolor`` properties on ``Axes`` have been
851+
The ``axisbg`` and ``axis_bgcolor`` properties on *Axes* have been
852852
deprecated in favor of ``facecolor``.
853853

854854
GTK and GDK backends deprecated
@@ -1281,8 +1281,8 @@ algorithm that was not necessarily applicable to custom Axes. Three new private
12811281
methods, :meth:`~matplotlib.axes._base._AxesBase._get_view`,
12821282
:meth:`~matplotlib.axes._base._AxesBase._set_view`, and
12831283
:meth:`~matplotlib.axes._base._AxesBase._set_view_from_bbox`, allow for custom
1284-
``Axes`` classes to override the pan and zoom algorithms. Implementors of
1285-
custom ``Axes`` who override these methods may provide suitable behaviour for
1284+
*Axes* classes to override the pan and zoom algorithms. Implementors of
1285+
custom *Axes* who override these methods may provide suitable behaviour for
12861286
both pan and zoom as well as the view navigation buttons on the interactive
12871287
toolbars.
12881288

doc/api/index.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,8 @@ Toolkits
7474
.. toctree::
7575
:maxdepth: 1
7676

77-
toolkits/axes_grid.rst
77+
7878
toolkits/mplot3d.rst
79+
toolkits/axes_grid1.rst
80+
toolkits/axisartist.rst
81+
toolkits/axes_grid.rst

doc/api/toolkits/axes_grid.rst

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
.. _axes_grid-api-index:
22

3-
####################################
4-
The Matplotlib axes_grid Toolkit API
5-
####################################
6-
7-
:Release: |version|
8-
:Date: |today|
3+
Matplotlib axes_grid Toolkit
4+
============================
95

106
.. currentmodule:: mpl_toolkits
117

12-
Axes Grid
13-
---------
8+
149
.. note::
15-
16-
There is an older version of the AxesGrid toolkit, ``axes_grid`` (instead of
17-
``axes_grid1``). The old version had a single namespace for all axes_grid
18-
objects, and in the new version this toolkit was broken
19-
into the two modules below. For the documentation on ``axes_grid``,
10+
AxesGrid toolkit has been a part of matplotlib since v
11+
0.99. Originally, the toolkit had a single namespace of
12+
*axes_grid*. In more recent version, the toolkit
13+
has divided into two separate namespace (*axes_grid1* and *axisartist*).
14+
While *axes_grid* namespace is maintained for the backward compatibility,
15+
use of *axes_grid1* and *axisartist* is recommended.
16+
For the documentation on ``axes_grid``,
2017
see the `previous version of the docs
2118
<https://matplotlib.org/2.0.1/mpl_toolkits/axes_grid/index.html#toolkit-axesgrid-index>`_.
2219

23-
.. autosummary::
24-
:toctree: ../_as_gen
25-
:template: automodule.rst
20+
.. toctree::
21+
:maxdepth: 1
22+
23+
axes_grid1
24+
axisartist
25+
2626

27-
axes_grid1
28-
axisartist

doc/api/toolkits/axes_grid1.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.. _toolkit_axesgrid1-index:
2+
3+
Matplotlib axes_grid1 Toolkit
4+
=============================
5+
6+
The matplotlib :class:`mpl_toolkits.axes_grid1` toolkit is a collection of
7+
helper classes to ease displaying multiple images in matplotlib. While the
8+
aspect parameter in matplotlib adjust the position of the single axes,
9+
axes_grid1 toolkit provides a framework to adjust the position of
10+
multiple axes according to their aspects.
11+
12+
See :ref:`axes_grid1_users-guide-index` for a guide on the usage of axes_grid1.
13+
14+
.. figure:: ../../gallery/axes_grid1/images/sphx_glr_demo_axes_grid_001.png
15+
:target: ../../gallery/axes_grid1/demo_axes_grid.html
16+
:align: center
17+
:scale: 50
18+
19+
20+
21+
.. currentmodule:: mpl_toolkits
22+
23+
**The submodules of the axes_grid1 API are:**
24+
25+
.. autosummary::
26+
:toctree: ../_as_gen
27+
:template: automodule.rst
28+
29+
axes_grid1.anchored_artists
30+
axes_grid1.axes_divider
31+
axes_grid1.axes_grid
32+
axes_grid1.axes_rgb
33+
axes_grid1.axes_size
34+
axes_grid1.colorbar
35+
axes_grid1.inset_locator
36+
axes_grid1.mpl_axes
37+
axes_grid1.parasite_axes
38+
39+

doc/api/toolkits/axisartist.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
.. _toolkit_axisartist-index:
2+
3+
Matplotlib axisartist Toolkit
4+
=============================
5+
6+
The *axisartist* namespace includes a derived Axes implementation (
7+
:class:`mpl_toolkits.axisartist.Axes`). The
8+
biggest difference is that the artists that are responsible for drawing
9+
axis lines, ticks, ticklabels, and axis labels are separated out from the
10+
mpl's Axis class. This change was strongly motivated to support curvilinear grid.
11+
12+
You can find a tutorial describing usage of axisartist at the
13+
:ref:`axisartist_users-guide-index` user guide.
14+
15+
.. figure:: ../../gallery/axisartist/images/sphx_glr_demo_curvelinear_grid_001.png
16+
:target: ../../gallery/axisartist/demo_curvelinear_grid.html
17+
:align: center
18+
:scale: 50
19+
20+
.. currentmodule:: mpl_toolkits
21+
22+
**The submodules of the axisartist API are:**
23+
24+
.. autosummary::
25+
:toctree: ../_as_gen
26+
:template: automodule.rst
27+
28+
axisartist.angle_helper
29+
axisartist.axes_divider
30+
axisartist.axes_grid
31+
axisartist.axes_rgb
32+
axisartist.axis_artist
33+
axisartist.axisline_style
34+
axisartist.axislines
35+
axisartist.clip_path
36+
axisartist.floating_axes
37+
axisartist.grid_finder
38+
axisartist.grid_helper_curvelinear
39+
axisartist.parasite_axes
40+

doc/mpl_toolkits/index.rst renamed to doc/api/toolkits/index.rst

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ lighter weight solution for some use cases. Check out the
2424
:ref:`mplot3d tutorial <sphx_glr_tutorials_toolkits_mplot3d.py>` for more
2525
information.
2626

27-
.. figure:: ../gallery/mplot3d/images/sphx_glr_contourf3d_2_001.png
28-
:target: ../gallery/mplot3d/contourf3d_2.html
27+
.. figure:: ../../gallery/mplot3d/images/sphx_glr_contourf3d_2_001.png
28+
:target: ../../gallery/mplot3d/contourf3d_2.html
2929
:align: center
3030
:scale: 50
3131

@@ -41,37 +41,20 @@ Links
4141
-----
4242
* mpl3d API: :ref:`toolkit_mplot3d-api`
4343

44-
.. _toolkit_axes_grid1:
44+
.. _toolkit_axes_grid1_incl:
4545

46-
axes_grid1
47-
==========
46+
.. include:: axes_grid1.rst
47+
:start-line: 1
4848

49-
The :mod:`mpl_toolkits.axes_grid1` toolkit is a
50-
collection of helper classes for displaying multiple axes in Matplotlib.
49+
.. _toolkit_axisartist_incl:
50+
51+
.. include:: axisartist.rst
52+
:start-line: 1
5153

52-
.. image:: /_static/demo_axes_grid.png
53-
54-
.. toctree::
55-
:maxdepth: 2
56-
57-
axes_grid1/index.rst
58-
59-
60-
.. _toolkit_axisartist:
61-
62-
axisartist
63-
==========
64-
65-
The :mod:`mpl_toolkits.axisartist` toolkit contains
66-
a custom Axes class that is meant to support curvilinear grids.
67-
68-
.. toctree::
69-
:maxdepth: 2
70-
71-
axisartist/index.rst
54+
.. _toolkit_axes_grid_incl:
55+
56+
.. include:: axes_grid.rst
57+
:start-line: 1
7258

7359

74-
API
75-
---
76-
* Axes Grid and Axis Artist API: :ref:`axes_grid-api-index`
7760

File renamed without changes.

doc/mpl_toolkits/mplot3d/index.rst renamed to doc/api/toolkits/mplot3d/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The resulting graph will have the same look and feel as regular 2D plots.
1414
See the :ref:`mplot3d tutorial <sphx_glr_tutorials_toolkits_mplot3d.py>` for
1515
more information on how to use this toolkit.
1616

17-
.. image:: ../../_static/demo_mplot3d.png
17+
.. image:: /_static/demo_mplot3d.png
1818

1919
The interactive backends also provide the ability to rotate and zoom
2020
the 3D scene. One can rotate the 3D scene by simply clicking-and-dragging

doc/contents.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Overview
1616

1717
users/index.rst
1818
faq/index.rst
19-
mpl_toolkits/index.rst
19+
api/toolkits/index.rst
2020
resources/index.rst
2121
thirdpartypackages/index.rst
2222
api/index.rst

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ require changes to your existing code is logged in the :doc:`API changes
142142
Toolkits
143143
========
144144

145-
Matplotlib ships with several add-on :doc:`toolkits <mpl_toolkits/index>`,
145+
Matplotlib ships with several add-on :doc:`toolkits <api/toolkits/index>`,
146146
including 3d plotting with `mplot3d`, axes helpers in `axes_grid1` and axis
147147
helpers in `axisartist`.
148148

doc/mpl_toolkits/axes_grid1/index.rst

Lines changed: 0 additions & 24 deletions
This file was deleted.

doc/mpl_toolkits/axisartist/index.rst

Lines changed: 0 additions & 13 deletions
This file was deleted.

lib/matplotlib/figure.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ def _stale_figure_callback(self, val):
5858

5959
class AxesStack(Stack):
6060
"""
61-
Specialization of the `.Stack` to handle all tracking of `.Axes` in a
62-
`.Figure`. This stack stores ``key, (ind, axes)`` pairs, where:
61+
Specialization of the `.Stack` to handle all tracking of
62+
`~matplotlib.axes.Axes` in a `.Figure`.
63+
This stack stores ``key, (ind, axes)`` pairs, where:
6364
6465
* **key** should be a hash of the args and kwargs
6566
used in generating the Axes.
@@ -994,7 +995,8 @@ def set_frameon(self, b):
994995

995996
def delaxes(self, ax):
996997
"""
997-
Remove the `.Axes` *ax* from the figure and update the current axes.
998+
Remove the `~matplotlib.axes.Axes` *ax* from the figure and update the
999+
current axes.
9981000
"""
9991001
self._axstack.remove(ax)
10001002
for func in self._axobservers:
@@ -2114,7 +2116,8 @@ def align_xlabels(self, axs=None):
21142116
Parameters
21152117
----------
21162118
axs : list of `~matplotlib.axes.Axes`
2117-
Optional list of (or ndarray) `.Axes` to align the xlabels.
2119+
Optional list of (or ndarray) `~matplotlib.axes.Axes`
2120+
to align the xlabels.
21182121
Default is to align all axes on the figure.
21192122
21202123
See Also
@@ -2182,7 +2185,8 @@ def align_ylabels(self, axs=None):
21822185
Parameters
21832186
----------
21842187
axs : list of `~matplotlib.axes.Axes`
2185-
Optional list (or ndarray) of `.Axes` to align the ylabels.
2188+
Optional list (or ndarray) of `~matplotlib.axes.Axes`
2189+
to align the ylabels.
21862190
Default is to align all axes on the figure.
21872191
21882192
See Also
@@ -2245,7 +2249,8 @@ def align_labels(self, axs=None):
22452249
Parameters
22462250
----------
22472251
axs : list of `~matplotlib.axes.Axes`
2248-
Optional list (or ndarray) of `.Axes` to align the labels.
2252+
Optional list (or ndarray) of `~matplotlib.axes.Axes`
2253+
to align the labels.
22492254
Default is to align all axes on the figure.
22502255
22512256
See Also

lib/matplotlib/legend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def __init__(self, parent, handles, labels,
346346
"""
347347
Parameters
348348
----------
349-
parent : `.Axes` or `.Figure`
349+
parent : `~matplotlib.axes.Axes` or `.Figure`
350350
The artist that contains the legend.
351351
352352
handles : sequence of `.Artist`

0 commit comments

Comments
 (0)