11
11
assert_array_equal , assert_array_almost_equal )
12
12
import pytest
13
13
14
- from matplotlib .transforms import (Affine2D , BlendedGenericTransform , Bbox ,
15
- TransformedPath , TransformedPatchPath )
14
+ import matplotlib .pyplot as plt
15
+ import matplotlib .patches as mpatches
16
+ import matplotlib .transforms as mtrans
16
17
from matplotlib .path import Path
17
18
from matplotlib .scale import LogScale
18
19
from matplotlib .testing .decorators import cleanup , image_comparison
19
20
20
- import matplotlib .transforms as mtrans
21
- import matplotlib .pyplot as plt
22
- import matplotlib .patches as mpatches
23
-
24
21
25
22
@cleanup
26
23
def test_non_affine_caching ():
@@ -199,8 +196,8 @@ def test_clipping_of_log():
199
196
path = Path (points , codes )
200
197
201
198
# something like this happens in plotting logarithmic histograms
202
- trans = BlendedGenericTransform (Affine2D (),
203
- LogScale .Log10Transform ('clip' ))
199
+ trans = mtrans . BlendedGenericTransform (mtrans . Affine2D (),
200
+ LogScale .Log10Transform ('clip' ))
204
201
tpath = trans .transform_path_non_affine (path )
205
202
result = tpath .iter_segments (trans .get_affine (),
206
203
clip = (0 , 0 , 100 , 100 ),
@@ -518,8 +515,8 @@ def test_log_transform():
518
515
519
516
@cleanup
520
517
def test_nan_overlap ():
521
- a = Bbox ([[0 , 0 ], [1 , 1 ]])
522
- b = Bbox ([[0 , 0 ], [1 , np .nan ]])
518
+ a = mtrans . Bbox ([[0 , 0 ], [1 , 1 ]])
519
+ b = mtrans . Bbox ([[0 , 0 ], [1 , np .nan ]])
523
520
assert not a .overlaps (b )
524
521
525
522
@@ -577,7 +574,7 @@ def test_transformed_path():
577
574
path = Path (points , codes )
578
575
579
576
trans = mtrans .Affine2D ()
580
- trans_path = TransformedPath (path , trans )
577
+ trans_path = mtrans . TransformedPath (path , trans )
581
578
assert_allclose (trans_path .get_fully_transformed_path ().vertices , points )
582
579
583
580
# Changing the transform should change the result.
@@ -598,7 +595,7 @@ def test_transformed_patch_path():
598
595
trans = mtrans .Affine2D ()
599
596
patch = mpatches .Wedge ((0 , 0 ), 1 , 45 , 135 , transform = trans )
600
597
601
- tpatch = TransformedPatchPath (patch )
598
+ tpatch = mtrans . TransformedPatchPath (patch )
602
599
points = tpatch .get_fully_transformed_path ().vertices
603
600
604
601
# Changing the transform should change the result.
0 commit comments