File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -10,16 +10,16 @@ def test_obj_comparison():
1010 from matplotlib .axes import Subplot , Axes
1111 import matplotlib
1212
13- mpl_version = tuple (int (v ) for v in matplotlib .__version__ .split ("." ))
13+ mpl_version = tuple (int (v ) for v in matplotlib .__version__ .split ("." )[: 2 ] )
1414
1515 view_class1 = view_wrapper (Subplot )
1616 view_class2 = view_wrapper (Subplot )
1717 view_class3 = view_wrapper (Axes )
1818
1919 assert view_class1 is view_class2
2020 assert view_class1 == view_class2
21- if (mpl_version >= (3 , 7 , 0 )):
22- # As of 3.7.0, the subplot class no long exists, and is an alias to the Axes class...
21+ if (mpl_version >= (3 , 7 )):
22+ # As of 3.7.0, the subplot class no longer exists, and is an alias to the Axes class...
2323 assert view_class2 == view_class3
2424 else :
2525 assert view_class2 != view_class3
Original file line number Diff line number Diff line change 44
55def figure_to_image (figure ):
66 figure .canvas .draw ()
7- img = np .frombuffer (figure .canvas .tostring_rgb (), dtype = np .uint8 )
8- return img .reshape (figure .canvas .get_width_height ()[::- 1 ] + (3 ,))
7+ img = np .frombuffer (figure .canvas .buffer_rgba (), dtype = np .uint8 )
8+ return img .reshape (figure .canvas .get_width_height ()[::- 1 ] + (4 ,))[..., : 3 ]
99
1010
1111def matches_post_pickle (figure ):
You can’t perform that action at this time.
0 commit comments