8000 All tests work as expected. · matplotlib/matplotlib@2286565 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2286565

Browse files
Phil Elsonpelson
Phil Elson
authored andcommitted
All tests work as expected.
1 parent 2f2ff13 commit 2286565

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

lib/matplotlib/tests/test_transforms.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
import matplotlib.transforms as mtrans
1414
import matplotlib.pyplot as plt
15+
import matplotlib.path as mpath
16+
import matplotlib.patches as mpatches
17+
1518

1619

1720
@cleanup
@@ -325,8 +328,29 @@ def test_line_extents_non_affine(self):
325328
expeted_data_lim = np.array([[0., 0.], [9., 9.]]) + 20
326329
np.testing.assert_array_almost_equal(ax.dataLim.get_points(),
327330
expeted_data_lim)
328-
329-
331+
332+
def test_pathc_extents_non_affine(self):
333+
ax = plt.axes()
334+
offset = mtrans.Affine2D().translate(10, 10)
335+
na_offset = NonAffineForTest(mtrans.Affine2D().translate(10, 10))
336+
pth = mpath.Path(np.array([[0, 0], [0, 10], [10, 10], [10, 0]]))
337+
patch = mpatches.PathPatch(pth, transform=offset + na_offset + ax.transData)
338+
ax.add_patch(patch)
339+
expeted_data_lim = np.array([[0., 0.], [10., 10.]]) + 20
340+
np.testing.assert_array_almost_equal(ax.dataLim.get_points(),
341+
expeted_data_lim)
342+
343+
def test_pathc_extents_affine(self):
344+
ax = plt.axes()
345+
offset = mtrans.Affine2D().translate(10, 10)
346+
pth = mpath.Path(np.array([[0, 0], [0, 10], [10, 10], [10, 0]]))
347+
patch = mpatches.PathPatch(pth, transform=offset + ax.transData)
348+
ax.add_patch(patch)
349+
expeted_data_lim = np.array([[0., 0.], [10., 10.]]) + 10
350+
np.testing.assert_array_almost_equal(ax.dataLim.get_points(),
351+
expeted_data_lim)
352+
353+
330354
if __name__=='__main__':
331355
import nose
332356
nose.runmodule(argv=['-s','--with-doctest'], exit=False)

lib/matplotlib/transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
import cbook
4747
from path import Path
4848

49-
DEBUG = True
49+
DEBUG = False
5050
if DEBUG:
5151
import warnings
5252

0 commit comments

Comments
 (0)
0