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

Skip to content

Commit 44fb5ea

Browse files
committed
Update axes_grid1 overview
Remove all use of axisartist from overview of axes_grid1
1 parent b41caa4 commit 44fb5ea

4 files changed

Lines changed: 46 additions & 47 deletions

File tree

doc/mpl_toolkits/axes_grid1/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Matplotlib AxesGrid1 Toolkit
77
The matplotlib :class:`mpl_toolkits.axes_grid1` toolkit is a collection of
88
helper classes to ease displaying multiple images in matplotlib. While the
99
aspect parameter in matplotlib adjust the position of the single axes,
10-
AxesGrid1 toolkit provides a framework to adjust the position of
10+
axesgrid1 toolkit provides a framework to adjust the position of
1111
multiple axes according to their aspects.
1212

1313

@@ -16,7 +16,7 @@ multiple axes according to their aspects.
1616
.. note::
1717
AxesGrid toolkit has been a part of matplotlib since v
1818
0.99. Originally, the toolkit had a single namespace of
19-
*axes_grid*. In more recent version (since svn r8226), the toolkit
19+
*axes_grid*. In more recent version, the toolkit
2020
has divided into two separate namespace (*axes_grid1* and *axisartist*).
2121
While *axes_grid* namespace is maintained for the backward compatibility,
2222
use of *axes_grid1* and *axisartist* is recommended.

doc/mpl_toolkits/axes_grid1/overview.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
Overview of AxesGrid1 toolkit
33
=============================
44

5-
What is AxesGrid1 toolkit?
6-
==========================
5+
What is axes_grid1 toolkit?
6+
===========================
77

8-
The matplotlib AxesGrid1 toolkit is a collection of helper classes,
8+
The matplotlib axes_grid1 toolkit is a collection of helper classes,
99
mainly to ease displaying (multiple) images in matplotlib.
1010

1111
.. contents::
@@ -38,7 +38,7 @@ like the legend.
3838
.. plot:: mpl_toolkits/axes_grid1/examples/demo_axes_grid.py
3939

4040

41-
Axes_grid1
41+
axes_grid1
4242
==========
4343

4444
ImageGrid
@@ -85,7 +85,7 @@ axes).
8585

8686

8787

88-
AxesGrid takes following arguments,
88+
ImageGrid takes following arguments,
8989

9090

9191
============= ======== ================================================
@@ -152,7 +152,7 @@ attribute.
152152

153153

154154

155-
The examples below show what you can do with AxesGrid.
155+
The examples below show what you can do with ImageGrid.
156156

157157
.. plot:: mpl_toolkits/axes_grid1/examples/demo_axes_grid.py
158158

@@ -267,7 +267,7 @@ tick-formatter for bottom(or left)-axis. ::
267267
r"$\pi$", r"$\frac{3}{2}\pi$", r"$2\pi$"])
268268

269269

270-
.. plot:: mpl_toolkits/axisartist/examples/simple_axisline4.py
270+
.. plot:: mpl_toolkits/axis_grid1/examples/simple_axisline4.py
271271

272272

273273

@@ -296,11 +296,11 @@ coordinate.
296296
InsetLocator
297297
------------
298298

299-
:mod:`mpl_toolkits.axes_grid.inset_locator` provides helper classes
299+
:mod:`mpl_toolkits.axes_grid1.inset_locator` provides helper classes
300300
and functions to place your (inset) axes at the anchored position of
301301
the parent axes, similarly to AnchoredArtist.
302302

303-
Using :func:`mpl_toolkits.axes_grid.inset_locator.inset_axes`, you
303+
Using :func:`mpl_toolkits.axes_grid1.inset_locator.inset_axes`, you
304304
can have inset axes whose size is either fixed, or a fixed proportion
305305
of the parent axes. For example,::
306306

examples/axes_grid1/demo_axes_grid.py

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import matplotlib.pyplot as plt
2-
from mpl_toolkits.axes_grid1 import AxesGrid
2+
from mpl_toolkits.axes_grid1 import ImageGrid
33

44

55
def get_demo_image():
@@ -16,11 +16,11 @@ def demo_simple_grid(fig):
1616
A grid of 2x2 images with 0.05 inch pad between images and only
1717
the lower-left axes is labeled.
1818
"""
19-
grid = AxesGrid(fig, 141, # similar to subplot(141)
20-
nrows_ncols=(2, 2),
21-
axes_pad=0.05,
22-
label_mode="1",
23-
)
19+
grid = ImageGrid(fig, 141, # similar to subplot(141)
20+
nrows_ncols=(2, 2),
21+
axes_pad=0.05,
22+
label_mode="1",
23+
)
2424

2525
Z, extent = get_demo_image()
2626
for i in range(4):
@@ -36,19 +36,18 @@ def demo_grid_with_single_cbar(fig):
3636
"""
3737
A grid of 2x2 images with a single colorbar
3838
"""
39-
grid = AxesGrid(fig, 142, # similar to subplot(142)
40-
nrows_ncols=(2, 2),
41-
axes_pad=0.0,
42-
share_all=True,
43-
label_mode="L",
44-
cbar_location="top",
45-
cbar_mode="single",
46-
)
39+
grid = ImageGrid(fig, 142, # similar to subplot(142)
40+
nrows_ncols=(2, 2),
41+
axes_pad=0.0,
42+
share_all=True,
43+
label_mode="L",
44+
cbar_location="top",
45+
cbar_mode="single",
46+
)
4747

4848
Z, extent = get_demo_image()
4949
for i in range(4):
5050
im = grid[i].imshow(Z, extent=extent, interpolation="nearest")
51-
#plt.colorbar(im, cax = grid.cbar_axes[0])
5251
grid.cbar_axes[0].colorbar(im)
5352

5453
for cax in grid.cbar_axes:
@@ -64,16 +63,16 @@ def demo_grid_with_each_cbar(fig):
6463
A grid of 2x2 images. Each image has its own colorbar.
6564
"""
6665

67-
grid = AxesGrid(fig, 143, # similar to subplot(143)
68-
nrows_ncols=(2, 2),
69-
axes_pad=0.1,
70-
label_mode="1",
71-
share_all=True,
72-
cbar_location="top",
73-
cbar_mode="each",
74-
cbar_size="7%",
75-
cbar_pad="2%",
76-
)
66+
grid = ImageGrid(fig, 143, # similar to subplot(143)
67+
nrows_ncols=(2, 2),
68+
axes_pad=0.1,
69+
label_mode="1",
70+
share_all=True,
71+
cbar_location="top",
72+
cbar_mode="each",
73+
cbar_size="7%",
74+
cbar_pad="2%",
75+
)
7776
Z, extent = get_demo_image()
7877
for i in range(4):
7978
im = grid[i].imshow(Z, extent=extent, interpolation="nearest")
@@ -92,16 +91,16 @@ def demo_grid_with_each_cbar_labelled(fig):
9291
A grid of 2x2 images. Each image has its own colorbar.
9392
"""
9493

95-
grid = AxesGrid(fig, 144, # similar to subplot(144)
96-
nrows_ncols=(2, 2),
97-
axes_pad=(0.45, 0.15),
98-
label_mode="1",
99-
share_all=True,
100-
cbar_location="right",
101-
cbar_mode="each",
102-
cbar_size="7%",
103-
cbar_pad="2%",
104-
)
94+
grid = ImageGrid(fig, 144, # similar to subplot(144)
95+
nrows_ncols=(2, 2),
96+
axes_pad=(0.45, 0.15),
97+
label_mode="1",
98+
share_all=True,
99+
cbar_location="right",
100+
cbar_mode="each",
101+
cbar_size="7%",
102+
cbar_pad="2%",
103+
)
105104
Z, extent = get_demo_image()
106105

107106
# Use a different colorbar range every time
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import mpl_toolkits.axisartist as AA
44
import numpy as np
55

6-
ax = host_subplot(111, axes_class=AA.Axes)
6+
ax = host_subplot(111)
77
xx = np.arange(0, 2*np.pi, 0.01)
88
ax.plot(xx, np.sin(xx))
99

0 commit comments

Comments
 (0)