@@ -718,3 +718,27 @@ def test_EventCollection_nosort():
718
718
arr = np .array ([3 , 2 , 1 , 10 ])
719
719
coll = EventCollection (arr )
720
720
np .testing .assert_array_equal (arr , np .array ([3 , 2 , 1 , 10 ]))
721
+
722
+
723
+ def test_collection_set_verts_array ():
724
+ verts = np .arange (80 , dtype = np .double ).reshape (10 , 4 , 2 )
725
+ col_arr = PolyCollection (verts )
726
+ col_list = PolyCollection (list (verts ))
727
+ assert len (col_arr ._paths ) == len (col_list ._paths )
728
+ for ap , lp in zip (col_arr ._paths , col_list ._paths ):
729
+ assert np .array_equal (ap ._vertices , lp ._vertices )
730
+ assert np .array_equal (ap ._codes , lp ._codes )
731
+
732
+
733
+ def test_blended_collection_autolim ():
734
+ a = [1 , 2 , 4 ]
735
+ height = .2
736
+
737
+ xy_pairs = np .column_stack ([np .repeat (a , 2 ), np .tile ([0 , height ], len (a ))])
738
+ line_segs = xy_pairs .reshape ([len (a ), 2 , 2 ])
739
+
740
+ f , ax = plt .subplots ()
741
+ trans = mtransforms .blended_transform_factory (ax .transData , ax .transAxes )
742
+ ax .add_collection (LineCollection (line_segs , transform = trans ))
743
+ ax .autoscale_view (scalex = True , scaley = False )
744
+ np .testing .assert_allclose (ax .get_xlim (), [1. , 4. ])
0 commit comments