From 095ccb16d484eded577d1b961387f7e0be2b1f61 Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Mon, 22 Apr 2019 01:37:07 -0800 Subject: [PATCH 1/4] better title in plot_compare_evokeds (closes #6165) --- mne/viz/evoked.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mne/viz/evoked.py b/mne/viz/evoked.py index 75719125f0e..f1db8323134 100644 --- a/mne/viz/evoked.py +++ b/mne/viz/evoked.py @@ -1875,6 +1875,9 @@ def plot_compare_evokeds(evokeds, picks=None, gfp=False, colors=None, _validate_type(vlines, (list, tuple), "vlines", "list or tuple") picks = [] if picks is None else picks + picked_a_type = isinstance(picks, str) and picks in _DATA_CH_TYPES_SPLIT + if title is None and picked_a_type: + title = 'GFP, ' + picks picks = _picks_to_idx(info, picks, allow_empty=True) if len(picks) == 0: logger.info("No picks, plotting the GFP ...") From 5ca2ace9e8294600a12f9396f6fc9ac4d5022cdd Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Mon, 22 Apr 2019 02:02:51 -0800 Subject: [PATCH 2/4] use logger.info instead of warn --- mne/viz/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mne/viz/utils.py b/mne/viz/utils.py index 5c04bf8838a..cd00dc89b33 100644 --- a/mne/viz/utils.py +++ b/mne/viz/utils.py @@ -32,7 +32,8 @@ pick_info, _picks_by_type, pick_channels_cov) from ..rank import compute_rank from ..io.proj import setup_proj -from ..utils import verbose, set_config, warn, _check_ch_locs, _check_option +from ..utils import (verbose, set_config, warn, _check_ch_locs, _check_option, + logger) from ..selection import (read_selection, _SELECTIONS, _EEG_SELECTIONS, _divide_to_regions) @@ -2557,7 +2558,7 @@ def _set_title_multiple_electrodes(title, combine, ch_names, max_chans=6, title = "{} of {} {}".format( combine, len(ch_names), ch_type) elif len(ch_names) > max_chans and combine != "gfp": - warn("More than {} channels, truncating title ...".format( + logger.info("More than {} channels, truncating title ...".format( max_chans)) title += ", ...\n({} of {} {})".format( combine, len(ch_names), ch_type,) From 5899ff5254cdef73f8f9fdaff3fd5727730bbbd0 Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Mon, 22 Apr 2019 02:12:46 -0800 Subject: [PATCH 3/4] fix stupidity --- mne/viz/evoked.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mne/viz/evoked.py b/mne/viz/evoked.py index f1db8323134..9bb7c7dc51d 100644 --- a/mne/viz/evoked.py +++ b/mne/viz/evoked.py @@ -1877,7 +1877,7 @@ def plot_compare_evokeds(evokeds, picks=None, gfp=False, colors=None, picks = [] if picks is None else picks picked_a_type = isinstance(picks, str) and picks in _DATA_CH_TYPES_SPLIT if title is None and picked_a_type: - title = 'GFP, ' + picks + title = _handle_default('titles')[picks] picks = _picks_to_idx(info, picks, allow_empty=True) if len(picks) == 0: logger.info("No picks, plotting the GFP ...") From b4e5ebebaf7cff05444793f560a323bc57b8f5fa Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Mon, 22 Apr 2019 07:36:53 -0800 Subject: [PATCH 4/4] simplify --- mne/viz/evoked.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mne/viz/evoked.py b/mne/viz/evoked.py index 9bb7c7dc51d..fc7fe8f22d2 100644 --- a/mne/viz/evoked.py +++ b/mne/viz/evoked.py @@ -1875,8 +1875,7 @@ def plot_compare_evokeds(evokeds, picks=None, gfp=False, colors=None, _validate_type(vlines, (list, tuple), "vlines", "list or tuple") picks = [] if picks is None else picks - picked_a_type = isinstance(picks, str) and picks in _DATA_CH_TYPES_SPLIT - if title is None and picked_a_type: + if title is None and picks in _DATA_CH_TYPES_SPLIT: title = _handle_default('titles')[picks] picks = _picks_to_idx(info, picks, allow_empty=True) if len(picks) == 0: