Skip to content

Commit 52b7555

Browse files
committed
Change subplot(111, ...) to subplot(...) as 111 is the default.
1 parent 2486ba2 commit 52b7555

Some content is hidden

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

64 files changed

+144
-147
lines changed

examples/animation/double_pendulum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def derivs(state, t):
7171
y2 = -L2*cos(y[:, 2]) + y1
7272

7373
fig = plt.figure(figsize=(5, 4))
74-
ax = fig.add_subplot(111, autoscale_on=False, xlim=(-2, 2), ylim=(-2, 1))
74+
ax = fig.add_subplot(autoscale_on=False, xlim=(-2, 2), ylim=(-2, 1))
7575
ax.set_aspect('equal')
7676
ax.grid()
7777

examples/animation/unchained.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
fig = plt.figure(figsize=(8, 8), facecolor='black')
2222

2323
# Add a subplot with no frame
24-
ax = plt.subplot(111, frameon=False)
24+
ax = plt.subplot(frameon=False)
2525

2626
# Generate random data
2727
data = np.random.uniform(0, 1, (64, 75))

examples/axes_grid1/simple_colorbar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from mpl_toolkits.axes_grid1 import make_axes_locatable
99
import numpy as np
1010

11-
ax = plt.subplot(111)
11+
ax = plt.subplot()
1212
im = ax.imshow(np.arange(100).reshape((10, 10)))
1313

1414
# create an axes on the right side of ax. The width of cax will be 5%

examples/event_handling/trifinder_event_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def on_mouse_move(event):
5252
trifinder = triang.get_trifinder()
5353

5454
# Setup plot and callbacks.
55-
plt.subplot(111, aspect='equal')
55+
plt.subplot(aspect='equal')
5656
plt.triplot(triang, 'bo-')
5757
polygon = Polygon([[0, 0], [0, 0]], facecolor='y') # dummy data for (xs, ys)
5858
update_polygon(-1)

examples/misc/agg_buffer_to_array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525

2626
# now display the array X as an Axes in a new figure
2727
fig2 = plt.figure()
28-
ax2 = fig2.add_subplot(111, frameon=False)
28+
ax2 = fig2.add_subplot(frameon=False)
2929
ax2.imshow(X)
3030
plt.show()

examples/misc/custom_projection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ class HammerAxes(GeoAxes):
370370

371371
# The projection must specify a name. This will be used by the
372372
# user to select the projection,
373-
# i.e. ``subplot(111, projection='custom_hammer')``.
373+
# i.e. ``subplot(projection='custom_hammer')``.
374374
name = 'custom_hammer'
375375

376376
class HammerTransform(Transform):
@@ -441,7 +441,7 @@ def _get_core_transform(self, resolution):
441441
if __name__ == '__main__':
442442
import matplotlib.pyplot as plt
443443
# Now make a simple example using the custom projection.
444-
plt.subplot(111, projection="custom_hammer")
444+
plt.subplot(projection="custom_hammer")
445445
p = plt.plot([-1, 1, 1], [-1, -1, 1], "o-")
446446
plt.grid(True)
447447

examples/misc/customize_rc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ def set_pub():
2626
Then as you are working interactively, you just need to do::
2727
2828
>>> set_pub()
29-
>>> subplot(111)
3029
>>> plot([1, 2, 3])
3130
>>> savefig('myfig')
3231
>>> rcdefaults() # restore the defaults

examples/mplot3d/bars3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
fig = plt.figure()
18-
ax = fig.add_subplot(111, projection='3d')
18+
ax = fig.add_subplot(projection='3d')
1919

2020
colors = ['r', 'g', 'b', 'y']
2121
yticks = [3, 2, 1, 0]

examples/mplot3d/hist3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
fig = plt.figure()
17-
ax = fig.add_subplot(111, projection='3d')
17+
ax = fig.add_subplot(projection='3d')
1818
x, y = np.random.rand(2, 100) * 4
1919
hist, xedges, yedges = np.histogram2d(x, y, bins=4, range=[[0, 4], [0, 4]])
2020

examples/mplot3d/pathpatch3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def text3d(ax, xyz, s, zdir="z", size=None, angle=0, usetex=False, **kwargs):
4141

4242

4343
fig = plt.figure()
44-
ax = fig.add_subplot(111, projection='3d')
44+
ax = fig.add_subplot(projection='3d')
4545

4646
# Draw a circle on the x=0 'wall'
4747
p = Circle((5, 5), 3)

0 commit comments

Comments
 (0)