@@ -72,20 +72,20 @@ def test_plot_topomap_interactive(constrained_layout):
72
72
res = 8 , time_unit = 's' )
73
73
evoked .copy ().plot_topomap (proj = False , ** kwargs )
74
74
canvas .draw ()
75
- image_noproj = np .frombuffer (canvas .tostring_rgb (), dtype = 'uint8' )
75
+ image_noproj = np .frombuffer (canvas .tostring_argb (), dtype = 'uint8' )
76
76
assert len (plt .get_fignums ()) == 1
77
77
78
78
ax .clear ()
79
79
evoked .copy ().plot_topomap (proj = True , ** kwargs )
80
80
canvas .draw ()
81
- image_proj = np .frombuffer (canvas .tostring_rgb (), dtype = 'uint8' )
81
+ image_proj = np .frombuffer (canvas .tostring_argb (), dtype = 'uint8' )
82
82
assert not np .array_equal (image_noproj , image_proj )
83
83
assert len (plt .get_fignums ()) == 1
84
84
85
85
ax .clear ()
86
86
fig = evoked .copy ().plot_topomap (proj = 'interactive' , ** kwargs )
87
87
canvas .draw ()
88
- image_interactive = np .frombuffer (canvas .tostring_rgb (), dtype = 'uint8' )
88
+ image_interactive = np .frombuffer (canvas .tostring_argb (), dtype = 'uint8' )
89
89
assert_array_equal (image_noproj , image_interactive )
90
90
assert not np .array_equal (image_proj , image_interactive )
91
91
assert len (plt .get_fignums ()) == 2
@@ -97,7 +97,7 @@ def test_plot_topomap_interactive(constrained_layout):
97
97
assert _proj_status (fig , 'matplotlib' ) == [True ]
98
98
canvas .draw ()
99
99
image_interactive_click = np .frombuffer (
100
- canvas .tostring_rgb (), dtype = 'uint8' )
100
+ canvas .tostring_argb (), dtype = 'uint8' )
101
101
corr = np .corrcoef (
102
102
image_proj .ravel (), image_interactive_click .ravel ())[0 , 1 ]
103
103
assert 0.99 < corr <= 1
@@ -108,7 +108,7 @@ def test_plot_topomap_interactive(constrained_layout):
108
108
_fake_click (proj_fig , proj_fig .axes [0 ], [0.5 , 0.5 ], xform = 'ax' )
109
109
canvas .draw ()
110
110
image_interactive_click = np .frombuffer (
111
- canvas .tostring_rgb (), dtype = 'uint8' )
111
+ canvas .tostring_argb (), dtype = 'uint8' )
112
112
corr = np .corrcoef (
113
113
image_noproj .ravel (), image_interactive_click .ravel ())[0 , 1 ]
114
114
assert 0.99 < corr <= 1
0 commit comments