88
99import copy
1010from functools import partial
11+ import warnings
1112
1213import numpy as np
1314
@@ -649,7 +650,9 @@ def _prepare_mne_browse_raw(params, title, bgcolor, color, bad_color, inds,
649650
650651 figsize = _get_figsize_from_config ()
651652 params ['fig' ] = figure_nobar (facecolor = bgcolor , figsize = figsize )
652- params ['fig' ].canvas .set_window_title (title or "Raw" )
653+ with warnings .catch_warnings (record = True ):
654+ warnings .simplefilter ('ignore' )
655+ params ['fig' ].canvas .set_window_title (title or "Raw" )
653656 # most of the axes setup is done in _prepare_mne_browse
654657 _prepare_mne_browse (params , xlabel = 'Time (s)' )
655658 ax = params ['ax' ]
@@ -719,7 +722,9 @@ def _prepare_mne_browse_raw(params, title, bgcolor, color, bad_color, inds,
719722
720723 params ['lines' ] = [ax .plot ([np .nan ], antialiased = True , linewidth = 0.5 )[0 ]
721724 for _ in range (n_ch )]
722- ax .set_yticklabels (['X' * max ([len (ch ) for ch in info ['ch_names' ]])])
725+
726+ ax .set_yticklabels (['X' * max ([len (ch ) for ch in info ['ch_names' ]])] *
727+ len (params ['offsets' ]))
723728 params ['fig_annotation' ] = None
724729 params ['fig_help' ] = None
725730 params ['segment_line' ] = None
@@ -742,7 +747,6 @@ def _plot_raw_traces(params, color, bad_color, event_lines=None,
742747 offsets = params ['offsets' ]
743748 params ['bad_color' ] = bad_color
744749 ax = params ['ax' ]
745- labels = ax .yaxis .get_ticklabels ()
746750 # Scalebars
747751 for bar in params .get ('scalebars' , {}).values ():
748752 ax .lines .remove (bar )
@@ -751,6 +755,7 @@ def _plot_raw_traces(params, color, bad_color, event_lines=None,
751755 params ['ax' ].texts = []
752756 # do the plotting
753757 tick_list = list ()
758+ tick_colors = list ()
754759 for ii in range (n_channels ):
755760 ch_ind = ii + ch_start
756761 # let's be generous here and allow users to pass
@@ -798,13 +803,11 @@ def _plot_raw_traces(params, color, bad_color, event_lines=None,
798803 this_z = 2
799804 elif params ['types' ][ii ] == 'grad' :
800805 this_z = 3
801- for label in labels :
802- label .set_color ('black' )
803806 else :
804807 # set label color
805808 this_color = (bad_color if ch_name in info ['bads' ] else
806809 this_color )
807- labels [ ii ]. set_color (this_color )
810+ tick_colors . append (this_color )
808811 lines [ii ].set_zorder (this_z )
809812 # add a scale bar
810813 if (params ['show_scalebars' ] and
@@ -904,6 +907,11 @@ def _plot_raw_traces(params, color, bad_color, event_lines=None,
904907 params ['ax' ].set_yticks (params ['offsets' ][:len (tick_list )])
905908 params ['ax' ].set_yticklabels (tick_list , rotation = 0 )
906909 _set_ax_label_style (params ['ax' ], params )
910+ else :
911+ tick_colors = ['k' ] * len (params ['ax' ].get_yticks ())
912+ for tick_color , tick in zip (tick_colors ,
913+ params ['ax' ].yaxis .get_ticklabels ()):
914+ tick .set_color (tick_color )
907915 if 'fig_selection' not in params :
908916 params ['vsel_patch' ].set_y (params ['ch_start' ])
909917 params ['fig' ].canvas .draw ()
@@ -1055,7 +1063,9 @@ def _setup_browser_selection(raw, kind, selector=True):
10551063 if not selector :
10561064 return order
10571065 fig_selection = figure_nobar (figsize = (2 , 6 ), dpi = 80 )
1058- fig_selection .canvas .set_window_title ('Selection' )
1066+ with warnings .catch_warnings (record = True ):
1067+ warnings .simplefilter ('ignore' )
1068+ fig_selection .canvas .set_window_title ('Selection' )
10591069 rax = plt .subplot2grid ((6 , 1 ), (2 , 0 ), rowspan = 4 , colspan = 1 )
10601070 topo_ax = plt .subplot2grid ((6 , 1 ), (0 , 0 ), rowspan = 2 , colspan = 1 )
10611071 keys = np .concatenate ([keys , ['Custom' ]])
0 commit comments