@@ -72,20 +72,20 @@ def test_plot_topomap_interactive(constrained_layout):
7272                  res = 8 , time_unit = 's' )
7373    evoked .copy ().plot_topomap (proj = False , ** kwargs )
7474    canvas .draw ()
75-     image_noproj  =  np .frombuffer (canvas .tostring_rgb (), dtype = 'uint8' )
75+     image_noproj  =  np .frombuffer (canvas .tostring_argb (), dtype = 'uint8' )
7676    assert  len (plt .get_fignums ()) ==  1 
7777
7878    ax .clear ()
7979    evoked .copy ().plot_topomap (proj = True , ** kwargs )
8080    canvas .draw ()
81-     image_proj  =  np .frombuffer (canvas .tostring_rgb (), dtype = 'uint8' )
81+     image_proj  =  np .frombuffer (canvas .tostring_argb (), dtype = 'uint8' )
8282    assert  not  np .array_equal (image_noproj , image_proj )
8383    assert  len (plt .get_fignums ()) ==  1 
8484
8585    ax .clear ()
8686    fig  =  evoked .copy ().plot_topomap (proj = 'interactive' , ** kwargs )
8787    canvas .draw ()
88-     image_interactive  =  np .frombuffer (canvas .tostring_rgb (), dtype = 'uint8' )
88+     image_interactive  =  np .frombuffer (canvas .tostring_argb (), dtype = 'uint8' )
8989    assert_array_equal (image_noproj , image_interactive )
9090    assert  not  np .array_equal (image_proj , image_interactive )
9191    assert  len (plt .get_fignums ()) ==  2 
@@ -97,7 +97,7 @@ def test_plot_topomap_interactive(constrained_layout):
9797    assert  _proj_status (fig , 'matplotlib' ) ==  [True ]
9898    canvas .draw ()
9999    image_interactive_click  =  np .frombuffer (
100-         canvas .tostring_rgb (), dtype = 'uint8' )
100+         canvas .tostring_argb (), dtype = 'uint8' )
101101    corr  =  np .corrcoef (
102102        image_proj .ravel (), image_interactive_click .ravel ())[0 , 1 ]
103103    assert  0.99  <  corr  <=  1 
@@ -108,7 +108,7 @@ def test_plot_topomap_interactive(constrained_layout):
108108    _fake_click (proj_fig , proj_fig .axes [0 ], [0.5 , 0.5 ], xform = 'ax' )
109109    canvas .draw ()
110110    image_interactive_click  =  np .frombuffer (
111-         canvas .tostring_rgb (), dtype = 'uint8' )
111+         canvas .tostring_argb (), dtype = 'uint8' )
112112    corr  =  np .corrcoef (
113113        image_noproj .ravel (), image_interactive_click .ravel ())[0 , 1 ]
114114    assert  0.99  <  corr  <=  1 
0 commit comments