@@ -964,11 +964,10 @@ def __init__(self, ax, *args, **kwargs):
964964 self .ax .add_collection (col , autolim = False )
965965 self .collections .append (col )
966966
967- mins , maxs = self ._stickies
968967 for col in self .collections :
969- col .stickies .x [:] = [mins [0 ], maxs [0 ]]
970- col .stickies .y [:] = [mins [1 ], maxs [1 ]]
971- self .ax .update_datalim ([mins , maxs ])
968+ col .sticky_edges .x [:] = [self . _mins [0 ], self . _maxs [0 ]]
969+ col .sticky_edges .y [:] = [self . _mins [1 ], self . _maxs [1 ]]
970+ self .ax .update_datalim ([self . _mins , self . _maxs ])
972971 self .ax .autoscale_view (tight = True )
973972
974973 self .changed () # set the colors
@@ -1076,13 +1075,9 @@ def _process_args(self, *args, **kwargs):
10761075 raise ValueError ('allkinds has different length to allsegs' )
10771076
10781077 # Determine x,y bounds and update axes data limits.
1079- mins = np .min (
1080- [np .min (seg , axis = 0 ) for segs in self .allsegs for seg in segs ],
1081- axis = 0 )
1082- maxs = np .max (
1083- [np .max (seg , axis = 0 ) for segs in self .allsegs for seg in segs ],
1084- axis = 0 )
1085- self ._stickies = [mins , maxs ]
1078+ points = np .concatenate (self .allsegs , axis = 0 )
1079+ self ._mins = points .min (axis = 0 )
1080+ self ._maxs = points .max (axis = 0 )
10861081
10871082 def _get_allsegs_and_allkinds (self ):
10881083 """
@@ -1437,7 +1432,8 @@ def _process_args(self, *args, **kwargs):
14371432 contour_generator = args [0 ].Cntr
14381433 else :
14391434 contour_generator = args [0 ]._contour_generator
1440- self ._stickies = args [0 ]._stickies
1435+ self ._mins = args [0 ]._mins
1436+ self ._maxs = args [0 ]._maxs
14411437 else :
14421438 self ._corner_mask = kwargs .get ('corner_mask' , None )
14431439 if self ._corner_mask is None :
@@ -1470,7 +1466,8 @@ def _process_args(self, *args, **kwargs):
14701466 x = transformed_pts [..., 0 ]
14711467 y = transformed_pts [..., 1 ]
14721468
1473- self ._stickies = [(ma .min (x ), ma .min (y )), (ma .max (x ), ma .max (y ))]
1469+ self ._mins = [ma .min (x ), ma .min (y )]
1470+ self ._maxs = [ma .max (x ), ma .max (y )]
14741471
14751472 if self ._corner_mask == 'legacy' :
14761473 self .Cntr = contour_generator
0 commit comments