8000 Merge pull request #11999 from timhoffm/no-explicit-fignum · taehoonlee/matplotlib@f6ea9a5 · GitHub
[go: up one dir, main page]

Skip to content

Commit f6ea9a5

Browse files
authored
Merge pull request matplotlib#11999 from timhoffm/no-explicit-fignum
Do not use an explicit fignum plt.figure(1) in simple cases
2 parents 90037f4 + b2a8a04 commit f6ea9a5

File tree

16 files changed

+18
-18
lines changed

16 files changed

+18
-18
lines changed

examples/axes_grid1/demo_imagegrid_aspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import matplotlib.pyplot as plt
88

99
from mpl_toolkits.axes_grid1 import ImageGrid
10-
fig = plt.figure(1)
10+
fig = plt.figure()
1111

1212
grid1 = ImageGrid(fig, 121, (2, 2), axes_pad=0.1,
1313
aspect=True, share_all=True)

examples/axes_grid1/simple_rgb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def get_rgb():
3131
return R, G, B
3232

3333

34-
fig = plt.figure(1)
34+
fig = plt.figure()
3535
ax = RGBAxes(fig, [0.1, 0.1, 0.8, 0.8])
3636

3737
r, g, b = get_rgb()

examples/axisartist/demo_axisline_style.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import numpy as np
1212

1313
if 1:
14-
fig = plt.figure(1)
14+
fig = plt.figure()
1515
ax = SubplotZero(fig, 111)
1616
fig.add_subplot(ax)
1717

examples/axisartist/demo_parasite_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import matplotlib.pyplot as plt
2020

2121

22-
fig = plt.figure(1)
22+
fig = plt.figure()
2323

2424
host = HostAxes(fig, [0.15, 0.1, 0.65, 0.8])
2525
par1 = ParasiteAxes(host, sharex=host)

examples/axisartist/simple_axisartist1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import matplotlib.pyplot as plt
88
import mpl_toolkits.axisartist as AA
99

10-
fig = plt.figure(1)
10+
fig = plt.figure()
1111
fig.subplots_adjust(right=0.85)
1212
ax = AA.Subplot(fig, 1, 1, 1)
1313
fig.add_subplot(ax)

examples/axisartist/simple_axisline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from mpl_toolkits.axisartist.axislines import SubplotZero
1010

1111

12-
fig = plt.figure(1)
12+
fig = plt.figure()
1313
fig.subplots_adjust(right=0.85)
1414
ax = SubplotZero(fig, 1, 1, 1)
1515
fig.add_subplot(ax)

examples/lines_bars_and_markers/errorbar_limits_simple.py

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

3030
###############################################################################
3131

32-
fig = plt.figure(1)
32+
fig = plt.figure()
3333
x = np.arange(10.0) / 10.0
3434
y = (x + 0.1)**2
3535

examples/pyplots/pyplot_scales.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
x = np.arange(len(y))
2323

2424
# plot with various axes scales
25-
plt.figure(1)
25+
plt.figure()
2626

2727
# linear
2828
plt.subplot(221)

examples/pyplots/pyplot_two_subplots.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def f(t):
1414
t1 = np.arange(0.0, 5.0, 0.1)
1515
t2 = np.arange(0.0, 5.0, 0.02)
1616

17-
plt.figure(1)
17+
plt.figure()
1818
plt.subplot(211)
1919
plt.plot(t1, f(t1), 'bo', t2, f(t2), 'k')
2020

examples/pyplots/whats_new_99_axes_grid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def get_rgb():
3838
return R, G, B
3939

4040

41-
fig = plt.figure(1)
41+
fig = plt.figure()
4242
ax = RGBAxes(fig, [0.1, 0.1, 0.8, 0.8])
4343

4444
r, g, b = get_rgb()

0 commit comments

Comments
 (0)
0