8000 Fix PEP8 flake8 · matplotlib/matplotlib@1a5a2cb · GitHub
[go: up one dir, main page]

Skip to content

Commit 1a5a2cb

Browse files
committed
Fix PEP8 flake8
1 parent d1b16c3 commit 1a5a2cb

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def get_tightbbox(self, renderer):
118118
# For now, just return None to exclude from layout calculation.
119119
return None
120120

121-
121+
122122
def text_2d_to_3d(obj, z=0, zdir='z'):
123123
"""Convert a Text to a Text3D object."""
124124
obj.__class__ = Text3D

lib/mpl_toolkits/tests/test_mplot3d.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from mpl_toolkits.mplot3d import Axes3D, axes3d, proj3d, art3d
44
from matplotlib import cm
5-
from matplotlib.testing.decorators import image_comparison
5+
from matplotlib.testing.decorators import image_comparison, check_figures_equal
66
from matplotlib.collections import LineCollection
77
from matplotlib.patches import Circle
88
import matplotlib.pyplot as plt
@@ -163,6 +163,19 @@ def f(t):
163163
ax.set_zlim3d(-1, 1)
164164

165165

166+
@check_figures_equal(extensions=['png'])
167+
def test_tight_layout_text(fig_test, fig_ref):
168+
# text is currently ignored in tight layout. So the order of text() and
169+
# tight_layout() calls should not influence the result.
170+
ax1 = fig_test.gca(projection='3d')
171+
ax1.text(.5, .5, .5, s='some string')
172+
fig_test.tight_layout()
173+
174+
ax2 = fig_ref.gca(projection='3d')
175+
fig_ref.tight_layout()
176+
ax2.text(.5, .5, .5, s='some string')
177+
178+
166179
@image_comparison(baseline_images=['scatter3d'], remove_text=True)
167180
def test_scatter3d():
168181
fig = plt.figure()

0 commit comments

Comments
 (0)
0