@@ -3267,7 +3267,8 @@ def set_xlim(self, left=None, right=None, emit=True, auto=False,
32673267 reverse = left > right
32683268 left , right = self .xaxis .get_major_locator ().nonsingular (left , right )
32693269 left , right = self .xaxis .limit_range_for_scale (left , right )
3270- left , right = sorted ([left , right ], reverse = reverse )
3270+ # cast to bool to avoid bad interaction between python 3.8 and np.bool_
3271+ left , right = sorted ([left , right ], reverse = bool (reverse ))
32713272
32723273 self .viewLim .intervalx = (left , right )
32733274 if auto is not None :
@@ -3649,7 +3650,8 @@ def set_ylim(self, bottom=None, top=None, emit=True, auto=False,
36493650 reverse = bottom > top
36503651 bottom , top = self .yaxis .get_major_locator ().nonsingular (bottom , top )
36513652 bottom , top = self .yaxis .limit_range_for_scale (bottom , top )
3652- bottom , top = sorted ([bottom , top ], reverse = reverse )
3653+ # cast to bool to avoid bad interaction between python 3.8 and np.bool_
3654+ bottom , top = sorted ([bottom , top ], reverse = bool (reverse ))
36533655
36543656 self .viewLim .intervaly = (bottom , top )
36553657 if auto is not None :
0 commit comments