1111 assert_array_equal , assert_array_almost_equal )
1212import pytest
1313
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
1617from matplotlib .path import Path
1718from matplotlib .scale import LogScale
1819from matplotlib .testing .decorators import cleanup , image_comparison
1920
20- import matplotlib .transforms as mtrans
21- import matplotlib .pyplot as plt
22- import matplotlib .patches as mpatches
23-
2421
2522@cleanup
2623def test_non_affine_caching ():
@@ -199,8 +196,8 @@ def test_clipping_of_log():
199196 path = Path (points , codes )
200197
201198 # 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' ))
204201 tpath = trans .transform_path_non_affine (path )
205202 result = tpath .iter_segments (trans .get_affine (),
206203 clip = (0 , 0 , 100 , 100 ),
@@ -518,8 +515,8 @@ def test_log_transform():
518515
519516@cleanup
520517def 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 ]])
523520 assert not a .overlaps (b )
524521
525522
@@ -577,7 +574,7 @@ def test_transformed_path():
577574 path = Path (points , codes )
578575
579576 trans = mtrans .Affine2D ()
580- trans_path = TransformedPath (path , trans )
577+ trans_path = mtrans . TransformedPath (path , trans )
581578 assert_allclose (trans_path .get_fully_transformed_path ().vertices , points )
582579
583580 # Changing the transform should change the result.
@@ -598,7 +595,7 @@ def test_transformed_patch_path():
598595 trans = mtrans .Affine2D ()
599596 patch = mpatches .Wedge ((0 , 0 ), 1 , 45 , 135 , transform = trans )
600597
601- tpatch = TransformedPatchPath (patch )
598+ tpatch = mtrans . TransformedPatchPath (patch )
602599 points = tpatch .get_fully_transformed_path ().vertices
603600
604601 # Changing the transform should change the result.
0 commit comments