10000 Merge pull request #11998 from timhoffm/no-clf-after-figure · matplotlib/matplotlib@891515e · GitHub
[go: up one dir, main page]

Skip to content

Commit 891515e

Browse files
authored
Merge pull request #11998 from timhoffm/no-clf-after-figure
No clf() needed after creating a figure
2 parents 7a45b64 + 22bf44c commit 891515e

File tree

8 files changed

+2
-15
lines changed

8 files changed

+2
-15
lines changed

examples/axisartist/demo_axis_direction.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def add_floating_axis2(ax1):
7474

7575

7676
fig = plt.figure(figsize=(8, 4))
77-
fig.clf()
7877
fig.subplots_adjust( 10000 left=0.01, right=0.99, bottom=0.01, top=0.99,
7978
wspace=0.01, hspace=0.01)
8079

examples/axisartist/demo_curvelinear_grid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ def curvelinear_test2(fig):
130130

131131
ax1.grid(True, zorder=0)
132132

133+
133134
if 1:
134135
fig = plt.figure(figsize=(7, 4))
135-
fig.clf()
136136

137137
curvelinear_test1(fig)
138138
curvelinear_test2(fig)

examples/axisartist/demo_curvelinear_grid2.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,5 @@ def inv_tr(x, y):
6666

6767
if 1:
6868
fig = plt.figure(figsize=(7, 4))
69-
fig.clf()
70-
7169
curvelinear_test1(fig)
7270
plt.show()

examples/axisartist/demo_floating_axis.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ def curvelinear_test2(fig):
6464

6565
ax1.grid(True)
6666

67-
fig = plt.figure(figsize=(5, 5))
68-
fig.clf()
6967

68+
fig = plt.figure(figsize=(5, 5))
7069
curvelinear_test2(fig)
71-
7270
plt.show()

examples/axisartist/simple_axis_pad.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def add_floating_axis2(ax1):
7474

7575

7676
fig = plt.figure(figsize=(9, 3.))
77-
fig.clf()
7877
fig.subplots_adjust(left=0.01, right=0.99, bottom=0.01, top=0.99,
7978
wspace=0.01, hspace=0.01)
8079

examples/text_labels_and_annotations/demo_text_rotation_mode.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ def test_rotation_mode(fig, mode, subplot_location):
4545
if 1:
4646
import matplotlib.pyplot as plt
4747
fig = plt.figure(figsize=(5.5, 4))
48-
fig.clf()
49-
5048
test_rotation_mode(fig, "default", 121)
5149
test_rotation_mode(fig, "anchor", 122)
5250
plt.show()

lib/matplotlib/offsetbox.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1753,7 +1753,6 @@ def update_offset(self, dx, dy):
17531753
if __name__ == "__main__":
17541754
import matplotlib.pyplot as plt
17551755
fig = plt.figure()
1756-
fig.clf()
17571756
ax = plt.subplot(121)
17581757

17591758
#txt = ax.text(0.5, 0.5, "Test", size=30, ha="center", color="w")

lib/mpl_toolkits/tests/test_axisartist_floating_axes.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
def test_subplot():
1616
fig = plt.figure(figsize=(5, 5))
17-
fig.clf()
18-
1917
ax = Subplot(fig, 111)
2018
fig.add_subplot(ax)
2119

@@ -24,7 +22,6 @@ def test_subplot():
2422
extensions=['png'], style='default', tol=0.01)
2523
def test_curvelinear3():
2624
fig = plt.figure(figsize=(5, 5))
27-
fig.clf()
2825

2926
tr = (mtransforms.Affine2D().scale(np.pi / 180, 1) +
3027
mprojections.PolarAxes.PolarTransform())
@@ -80,7 +77,6 @@ def test_curvelinear3():
8077
extensions=['png'], style='default', tol=0.015)
8178
def test_curvelinear4():
8279
fig = plt.figure(figsize=(5, 5))
83-
fig.clf()
8480

8581
tr = (mtransforms.Affine2D().scale(np.pi / 180, 1) +
8682
mprojections.PolarAxes.PolarTransform())

0 commit comments

Comments
 (0)
0