Skip to content

Commit 5eec831

Browse files
committed
Merge pull request #5752 from jenshnielsen/axisgriddocs
Reorganise mpl_toolkits documentation
2 parents 73f90a2 + 301980c commit 5eec831

File tree

95 files changed

+626
-536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+626
-536
lines changed

doc/_templates/index.html

+13-5
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,21 @@ <h4>Need help?</h4>
160160

161161
<h1>Toolkits</h1>
162162

163-
<p>There are several matplotlib add-on <a href="{{ pathto('mpl_toolkits/index') }}">toolkits</a>,
164-
including a choice of two projection and mapping toolkits <a href="http://matplotlib.org/basemap">basemap</a> and
165-
<a href="http://scitools.org.uk/cartopy/docs/latest">cartopy</a>,
166-
3d plotting with <a href="{{ pathto('mpl_toolkits/mplot3d/index') }}">mplot3d</a>,
167-
axes and axis helpers in <a href="{{ pathto('mpl_toolkits/axes_grid/index') }}">axes_grid</a> and more.
163+
<p>Matplotlib ships with several add-on <a href="{{ pathto('mpl_toolkits/index') }}">toolkits</a>,
164+
Including 3d plotting with <a href="{{ pathto('mpl_toolkits/mplot3d/index') }}">mplot3d</a>,
165+
axes helpers in <a href="{{ pathto('mpl_toolkits/axes_grid1/index') }}">axes_grid1</a> and
166+
axis helpers in <a href="{{ pathto('mpl_toolkits/axisartist/index') }}">axisartist</a>.
168167
</p>
169168

169+
<h1>Third party packages</h1>
170+
171+
<p>A large number of third party <a href="{{ pathto('mpl_toolkits/index') }}">packages</a>
172+
extend and build on Matplotlib functionality,
173+
including a choice of two projection and mapping toolkits
174+
<a href="http://matplotlib.org/basemap">basemap</a> and
175+
<a href="http://scitools.org.uk/cartopy/docs/latest">cartopy</a>.
176+
</p>
177+
170178
<h1>Citing matplotlib</h1>
171179

172180
<p>
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
`mpl_toolkits.axes_grid` has been deprecated
2+
````````````````````````````````````````````
3+
4+
All functionallity from `mpl_toolkits.axes_grid` can be found in either
5+
`mpl_toolkits.axes_grid1` or `mpl_toolkits.axisartist`. Axes classes from
6+
`mpl_toolkits.axes_grid` based on `Axis` from `mpl_toolkits.axisartist` can be
7+
found in `mpl_toolkits.axisartist`

doc/conf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@
135135
('api', 'API'),
136136
('pylab_examples', 'pylab examples'),
137137
('mplot3d', 'mplot3d toolkit'),
138-
('axes_grid', 'axes_grid toolkit'),
138+
('axes_grid1', 'axes_grid1 toolkit'),
139+
('axisartist', 'axisartist toolkit'),
139140
('units', 'units'),
140141
('widgets', 'widgets'),
141142
)

doc/contents.rst

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Overview
1818
users/index.rst
1919
faq/index.rst
2020
resources/index.rst
21+
thirdpartypackages/index.rst
2122
devel/index.rst
2223
mpl_toolkits/index.rst
2324
api/index.rst

doc/make.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ def all():
149149

150150
required_symlinks = [
151151
('mpl_examples', '../examples/'),
152-
('mpl_toolkits/axes_grid/examples', '../../../examples/axes_grid/')
152+
('mpl_toolkits/axes_grid1/examples', '../../../examples/axes_grid1/'),
153+
('mpl_toolkits/axisartist/examples', '../../../examples/axisartist/')
153154
]
154155

155156
symlink_warnings = []

doc/mpl_toolkits/axes_grid/api/axes_divider_api.rst

-18
This file was deleted.

doc/mpl_toolkits/axes_grid/api/axes_grid_api.rst

-11
This file was deleted.

doc/mpl_toolkits/axes_grid/api/axes_size_api.rst

-6
This file was deleted.

doc/mpl_toolkits/axes_grid/api/axis_artist_api.rst

-16
This file was deleted.

doc/mpl_toolkits/axes_grid/examples

-1
This file was deleted.

doc/mpl_toolkits/axes_grid/index.rst

-36
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
:mod:`mpl_toolkits.axes_grid1.axes_divider`
3+
===========================================
4+
5+
.. autoclass:: mpl_toolkits.axes_grid1.axes_divider.Divider
6+
:members:
7+
:undoc-members:
8+
9+
10+
.. autoclass:: mpl_toolkits.axes_grid1.axes_divider.AxesLocator
11+
:members:
12+
:undoc-members:
13+
14+
.. autoclass:: mpl_toolkits.axes_grid1.axes_divider.SubplotDivider
15+
:members:
16+
17+
.. autoclass:: mpl_toolkits.axes_grid1.axes_divider.AxesDivider
18+
:members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
:mod:`mpl_toolkits.axes_grid1.axes_grid`
3+
========================================
4+
5+
.. autoclass:: mpl_toolkits.axes_grid1.axes_grid.Grid
6+
:members:
7+
:undoc-members:
8+
9+
.. autoclass:: mpl_toolkits.axes_grid1.axes_grid.ImageGrid
10+
:members:
11+
:undoc-members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
:mod:`mpl_toolkits.axes_grid1.axes_size`
2+
========================================
3+
4+
.. automodule:: mpl_toolkits.axes_grid1.axes_size
5+
:members: Fixed, Scaled, AxesX, AxesY, MaxWidth, MaxHeight, Fraction, Padded, from_any
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
1-
.. _axes_grid-api-index:
1+
.. _axes_grid1-api-index:
22

33
#######################################
4-
The Matplotlib AxesGrid Toolkit API
4+
The Matplotlib axes_grid1 Toolkit API
55
#######################################
66

77
:Release: |version|
88
:Date: |today|
99

1010
.. toctree::
1111

12+
anchored_artists_api.rst
1213
axes_size_api.rst
1314
axes_divider_api.rst
1415
axes_grid_api.rst
15-
axis_artist_api.rst
16-
17-
18-
#######################################
19-
The Matplotlib axes_grid1 Toolkit API
20-
#######################################
21-
22-
:Release: |version|
23-
:Date: |today|
24-
25-
.. toctree::
26-
27-
anchored_artists_api.rst
2816
inset_locator_api.rst

doc/mpl_toolkits/axes_grid1/examples

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../examples/axes_grid1/

doc/mpl_toolkits/axes_grid/figures/demo_colorbar_of_inset_axes.py renamed to doc/mpl_toolkits/axes_grid1/figures/demo_colorbar_of_inset_axes.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import matplotlib.pyplot as plt
22

3-
from mpl_toolkits.axes_grid.inset_locator import inset_axes, zoomed_inset_axes
4-
from mpl_toolkits.axes_grid.colorbar import colorbar
3+
from mpl_toolkits.axes_grid1.inset_locator import inset_axes, zoomed_inset_axes
4+
from mpl_toolkits.axes_grid1.colorbar import colorbar
55

66
def get_demo_image():
77
from matplotlib.cbook import get_sample_data
@@ -46,4 +46,3 @@ def get_demo_image():
4646

4747
plt.draw()
4848
plt.show()
49-

doc/mpl_toolkits/axes_grid/figures/demo_colorbar_with_axes_divider.py renamed to doc/mpl_toolkits/axes_grid1/figures/demo_colorbar_with_axes_divider.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import matplotlib.pyplot as plt
2-
from mpl_toolkits.axes_grid.axes_divider import make_axes_locatable
2+
from mpl_toolkits.axes_grid1.axes_divider import make_axes_locatable
33

4-
from mpl_toolkits.axes_grid.colorbar import colorbar
4+
from mpl_toolkits.axes_grid1.colorbar import colorbar
55
# from matplotlib.pyplot import colorbar
66

77
fig = plt.figure(1, figsize=(6, 3))
@@ -22,4 +22,3 @@
2222
cb2 = colorbar(im2, cax=cax2, orientation="horizontal")
2323
cax2.xaxis.set_ticks_position("top")
2424
plt.show()
25-

doc/mpl_toolkits/axes_grid/figures/demo_fixed_size_axes.py renamed to doc/mpl_toolkits/axes_grid1/figures/demo_fixed_size_axes.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import matplotlib.pyplot as plt
22

3-
from mpl_toolkits.axes_grid \
4-
import Divider, LocatableAxes, Size
3+
from mpl_toolkits.axes_grid1 import Divider, LocatableAxes, Size
54

65
def demo_fixed_size_axes():
76

doc/mpl_toolkits/axes_grid/figures/demo_new_colorbar.py renamed to doc/mpl_toolkits/axes_grid1/figures/demo_new_colorbar.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
cb1.ax.set_yticks([1, 3])
1111
ax1.set_title("Original MPL's colorbar w/\nset_yticks([1,3])", size=10)
1212

13-
from mpl_toolkits.axes_grid.colorbar import colorbar
13+
from mpl_toolkits.axes_grid1.colorbar import colorbar
1414
ax2 = fig.add_subplot(122)
1515
im2 = ax2.imshow([[1,2],[3,4]])
1616
cb2 = colorbar(im2)
1717
cb2.ax.set_yticks([1, 3])
1818
ax2.set_title("AxesGrid's colorbar w/\nset_yticks([1,3])", size=10)
1919

2020
plt.show()
21-

doc/mpl_toolkits/axes_grid/figures/simple_axes_divider1.py renamed to doc/mpl_toolkits/axes_grid1/figures/simple_axes_divider1.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from mpl_toolkits.axes_grid import Size, Divider
1+
from mpl_toolkits.axes_grid1 import Size, Divider
22
import matplotlib.pyplot as plt
33

44

55
fig1 = plt.figure(1, (6, 6))
66

77
# fixed size in inch
88
horiz = [Size.Fixed(1.), Size.Fixed(.5), Size.Fixed(1.5),
9-
Size.Fixed(.5)]
9+
Size.Fixed(.5)]
1010
vert = [Size.Fixed(1.5), Size.Fixed(.5), Size.Fixed(1.)]
1111

1212
rect = (0.1, 0.1, 0.8, 0.8)
@@ -25,6 +25,5 @@
2525
ax4.set_axes_locator(divider.new_locator(nx=2, nx1=4, ny=0))
2626

2727

28-
2928
plt.draw()
3029
plt.show()

doc/mpl_toolkits/axes_grid/figures/simple_axes_divider2.py renamed to doc/mpl_toolkits/axes_grid1/figures/simple_axes_divider2.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import mpl_toolkits.axes_grid.axes_size as Size
2-
from mpl_toolkits.axes_grid import Divider
1+
import mpl_toolkits.axes_grid1.axes_size as Size
2+
from mpl_toolkits.axes_grid1 import Divider
33
import matplotlib.pyplot as plt
44

55
fig1 = plt.figure(1, (5.5, 4.))

doc/mpl_toolkits/axes_grid/figures/simple_axes_divider3.py renamed to doc/mpl_toolkits/axes_grid1/figures/simple_axes_divider3.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import mpl_toolkits.axes_grid.axes_size as Size
2-
from mpl_toolkits.axes_grid import Divider
1+
import mpl_toolkits.axes_grid1.axes_size as Size
2+
from mpl_toolkits.axes_grid1 import Divider
33
import matplotlib.pyplot as plt
44

55

doc/mpl_toolkits/axes_grid1/index.rst

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
.. _toolkit_axesgrid1-index:
3+
4+
Matplotlib axes_grid1 Toolkit
5+
=============================
6+
7+
The matplotlib :class:`mpl_toolkits.axes_grid1` toolkit is a collection of
8+
helper classes to ease displaying multiple images in matplotlib. While the
9+
aspect parameter in matplotlib adjust the position of the single axes,
10+
axesgrid1 toolkit provides a framework to adjust the position of
11+
multiple axes according to their aspects.
12+
13+
14+
.. image:: ../../_static/demo_axes_grid.png
15+
16+
.. note::
17+
AxesGrid toolkit has been a part of matplotlib since v
18+
0.99. Originally, the toolkit had a single namespace of
19+
*axes_grid*. In more recent version, the toolkit
20+
has divided into two separate namespace (*axes_grid1* and *axisartist*).
21+
While *axes_grid* namespace is maintained for the backward compatibility,
22+
use of *axes_grid1* and *axisartist* is recommended.
23+
24+
.. toctree::
25+
:maxdepth: 2
26+
27+
overview.rst
28+
users/index.rst
29+
api/index.rst

0 commit comments

Comments
 (0)