Skip to content

Commit d2758fd

Browse files
resurrect axes_grid1 doc
1 parent 304154c commit d2758fd

20 files changed

+125
-59
lines changed

doc/_templates/autosummary.rst

+3
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66
.. auto{{ objtype }}:: {{ objname }}
77
88
{% if objtype in ['class', 'method', 'function'] %}
9+
{% if objname not in ['AxesGrid', 'Scalable', 'HostAxes', 'FloatingAxes',
10+
'ParasiteAxesAuxTrans', 'ParasiteAxes'] %}
911

1012
.. include:: {{module}}.{{objname}}.examples
1113

1214
.. raw:: html
1315

1416
<div class="clearer"></div>
1517

18+
{% endif %}
1619
{% endif %}

doc/api/api_changes.rst

+4-4
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/toolkits/axes_grid.rst

+5-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The Matplotlib axes_grid Toolkit API
1010
.. currentmodule:: mpl_toolkits
1111

1212
Axes Grid
13-
---------
13+
=========
1414
.. note::
1515

1616
There is an older version of the AxesGrid toolkit, ``axes_grid`` (instead of
@@ -20,9 +20,8 @@ Axes Grid
2020
see the `previous version of the docs
2121
<https://matplotlib.org/2.0.1/mpl_toolkits/axes_grid/index.html#toolkit-axesgrid-index>`_.
2222

23-
.. autosummary::
24-
:toctree: ../_as_gen
25-
:template: automodule.rst
2623

27-
axes_grid1
28-
axisartist
24+
25+
:ref:`toolkit_axisartist-index`
26+
27+
:ref:`toolkit_axesgrid1-index`

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

+24
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,27 @@ See :ref:`axes_grid1_users-guide-index` for a guide on the usage of axes_grid1.
2222
has divided into two separate namespace (*axes_grid1* and *axisartist*).
2323
While *axes_grid* namespace is maintained for the backward compatibility,
2424
use of *axes_grid1* and *axisartist* is recommended.
25+
26+
27+
.. currentmodule:: mpl_toolkits
28+
29+
.. _toolkit-axes-grid1-api:
30+
31+
:mod:`mpl_toolkits.axes_grid1`
32+
===================================
33+
34+
.. autosummary::
35+
:toctree: ../_as_gen
36+
:template: automodule.rst
37+
38+
axes_grid1.anchored_artists
39+
axes_grid1.axes_divider
40+
axes_grid1.axes_grid
41+
axes_grid1.axes_rgb
42+
axes_grid1.axes_size
43+
axes_grid1.colorbar
44+
axes_grid1.inset_locator
45+
axes_grid1.mpl_axes
46+
axes_grid1.parasite_axes
47+
48+

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

+26
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,29 @@ mpl's Axis class. This change was strongly motivated to support curvilinear grid
1111

1212
You can find a tutorial describing usage of axisartist at
1313
:ref:`axisartist_users-guide-index`.
14+
15+
16+
.. currentmodule:: mpl_toolkits
17+
18+
.. _toolkit-axisartist-api:
19+
20+
:mod:`mpl_toolkits.axisartist`
21+
===================================
22+
23+
.. autosummary::
24+
:toctree: ../_as_gen
25+
:template: automodule.rst
26+
27+
axisartist.angle_helper
28+
axisartist.axes_divider
29+
axisartist.axes_grid
30+
axisartist.axes_rgb
31+
axisartist.axis_artist
32+
axisartist.axisline_style
33+
axisartist.axislines
34+
axisartist.clip_path
35+
axisartist.floating_axes
36+
axisartist.grid_finder
37+
axisartist.grid_helper_curvelinear
38+
axisartist.parasite_axes
39+

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

+4-4
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

@@ -54,7 +54,7 @@ collection of helper classes for displaying multiple axes in Matplotlib.
5454
.. toctree::
5555
:maxdepth: 2
5656

57-
axes_grid1/index.rst
57+
axes_grid1.rst
5858

5959

6060
.. _toolkit_axisartist:
@@ -68,7 +68,7 @@ a custom Axes class that is meant to support curvilinear grids.
6868
.. toctree::
6969
:maxdepth: 2
7070

71-
axisartist/index.rst
71+
axisartist.rst
7272

7373

7474
API
File renamed without changes.

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

+1-1
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

+1-1
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

+1-1
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/make.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if "%SPHINXBUILD%" == "" (
1010
set SOURCEDIR=.
1111
set BUILDDIR=build
1212
set SPHINXPROJ=matplotlib
13-
set SPHINXOPTS=-W
13+
set SPHINXOPTS=
1414
set O=
1515

1616
%SPHINXBUILD% >NUL 2>NUL

lib/matplotlib/figure.py

+11-6
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

+1-1
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`

lib/matplotlib/pyplot.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -782,9 +782,9 @@ def axes(arg=None, **kwargs):
782782
- 4-tuple of floats *rect* = ``[left, bottom, width, height]``.
783783
A new axes is added with dimensions *rect* in normalized
784784
(0, 1) units using `~.Figure.add_axes` on the current figure.
785-
- `.Axes`: This is equivalent to `.pyplot.sca`. It sets the current
786-
axes to *arg*. Note: This implicitly changes the current figure to
787-
the parent of *arg*.
785+
- `~matplotlib.axes.Axes`: This is equivalent to `.pyplot.sca`.
786+
It sets the current axes to *arg*. Note: This implicitly
787+
changes the current figure to the parent of *arg*.
788788
789789
.. note:: The use of an Axes as an argument is deprecated and will be
790790
removed in v3.0. Please use `.pyplot.sca` instead.
@@ -898,16 +898,16 @@ def subplot(*args, **kwargs):
898898
899899
subplot(nrows, ncols, index, **kwargs)
900900
901-
In the current figure, create and return an `.Axes`, at position *index*
902-
of a (virtual) grid of *nrows* by *ncols* axes. Indexes go from 1 to
903-
``nrows * ncols``, incrementing in row-major order.
901+
In the current figure, create and return an `~matplotlib.axes.Axes`,
902+
at position *index* of a (virtual) grid of *nrows* by *ncols* axes.
903+
Indexes go from 1 to ``nrows * ncols``, incrementing in row-major order.
904904
905905
If *nrows*, *ncols* and *index* are all less than 10, they can also be
906906
given as a single, concatenated, three-digit number.
907907
908908
For example, ``subplot(2, 3, 3)`` and ``subplot(233)`` both create an
909-
`.Axes` at the top right corner of the current figure, occupying half of
910-
the figure height and a third of the figure width.
909+
`matplotlib.axes.Axes` at the top right corner of the current figure,
910+
occupying half of the figure height and a third of the figure width.
911911
912912
.. note::
913913

lib/mpl_toolkits/axes_grid1/colorbar.py

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'''
1+
"""
22
Colorbar toolkit with two classes and a function:
33
44
:class:`ColorbarBase`
@@ -16,8 +16,8 @@
1616
The :meth:`~matplotlib.figure.Figure.colorbar` method uses :func:`make_axes`
1717
and :class:`Colorbar`; the :func:`~matplotlib.pyplot.colorbar` function
1818
is a thin wrapper over :meth:`~matplotlib.figure.Figure.colorbar`.
19+
"""
1920

20-
'''
2121
from __future__ import (absolute_import, division, print_function,
2222
unicode_literals)
2323

@@ -132,9 +132,9 @@
132132
Additional keyword arguments are of two kinds:
133133
134134
axes properties:
135-
%s
135+
%s
136136
colorbar properties:
137-
%s
137+
%s
138138
139139
If *mappable* is a :class:`~matplotlib.contours.ContourSet`, its *extend*
140140
kwarg is included automatically.
@@ -175,7 +175,7 @@
175175
unconventional value is to prevent underflow when log scale is used.
176176
''' % (make_axes_kw_doc, colormap_kw_doc)
177177

178-
docstring.interpd.update(colorbar_doc=colorbar_doc)
178+
#docstring.interpd.update(colorbar_doc=colorbar_doc)
179179

180180

181181
class CbarAxesLocator(object):
@@ -759,7 +759,9 @@ def update_bruteforce(self, mappable):
759759
def make_axes(parent, **kw):
760760
'''
761761
Resize and reposition a parent axes, and return a child
762-
axes suitable for a colorbar::
762+
axes suitable for a colorbar
763+
764+
::
763765
764766
cax, kw = make_axes(parent, **kw)
765767
@@ -801,13 +803,14 @@ def make_axes(parent, **kw):
801803
cax.set_aspect(aspect, anchor=anchor, adjustable='box')
802804
return cax, kw
803805

804-
806+
@docstring.Substitution(colorbar_doc)
805807
def colorbar(mappable, cax=None, ax=None, **kw):
806808
"""
807809
Create a colorbar for a ScalarMappable instance.
808810
809811
Documentation for the pylab thin wrapper:
810-
%(colorbar_doc)s
812+
813+
%s
811814
"""
812815
import matplotlib.pyplot as plt
813816
if ax is None:

lib/mpl_toolkits/axisartist/axis_artist.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
The text angles are actually relative to (90 + angle of the direction
6060
to the ticklabel), which gives 0 for bottom axis.
6161
62-
left bottom right top
62+
Parameter left bottom right top
6363
ticklabels location left right right left
6464
axislabel location left right right left
6565
ticklabels angle 90 0 -90 180
@@ -83,6 +83,7 @@
8383
* AxisLabel : pad
8484
8585
"""
86+
8687
from __future__ import (absolute_import, division, print_function,
8788
unicode_literals)
8889

lib/mpl_toolkits/axisartist/floating_axes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def __init__(self, aux_trans, extremes,
236236
objects which defines the transform and its inverse. The callables
237237
need take two arguments of array of source coordinates and
238238
should return two target coordinates:
239-
e.g., x2, y2 = trans(x1, y1)
239+
e.g., *x2, y2 = trans(x1, y1)*
240240
"""
241241

242242
self._old_values = None

tutorials/advanced/transforms_tutorial.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
| | |controlled by xlim and ylim. |
2626
+-----------+-----------------------------+-----------------------------------+
2727
|"axes" |``ax.transAxes`` |The coordinate system of the |
28-
| | |`.Axes`; (0, 0) is bottom left of |
29-
| | |the axes, and (1, 1) is top right |
30-
| | |of the axes. |
28+
| | |`~matplotlib.axes.Axes`; (0, 0) |
29+
| | |is bottom left of the axes, and |
30+
| | |(1, 1) is top right of the axes. |
3131
+-----------+-----------------------------+-----------------------------------+
3232
|"figure" |``fig.transFigure`` |The coordinate system of the |
3333
| | |`.Figure`; (0, 0) is bottom left |

0 commit comments

Comments
 (0)