Repository: mne-tools/mne-python

Issue:
plot_compare_evoked title bug
Note to self, fix this bug.


Discussion:

Resolving patch:
diff --git a/mne/viz/evoked.py b/mne/viz/evoked.py
--- a/mne/viz/evoked.py
+++ b/mne/viz/evoked.py
@@ -1610,7 +1610,7 @@ def convert_colors(color):
 
 def plot_compare_evokeds(evokeds, picks=None, gfp=False, colors=None,
                          linestyles=['-'], styles=None, cmap=None,
-                         vlines="auto", ci=0.95, truncate_yaxis=False,
+                         vlines="auto", ci=0.95, truncate_yaxis="max_ticks",
                          truncate_xaxis=True, ylim=dict(), invert_y=False,
                          show_sensors=None, show_legend=True,
                          split_legend=False, axes=None, title=None, show=True):
@@ -1707,12 +1707,12 @@ def plot_compare_evokeds(evokeds, picks=None, gfp=False, colors=None,
         it must take as its single argument an array (observations x times) and
         return the upper and lower confidence bands.
         If None or False, no confidence band is plotted.
-        If True, the 95% confidence interval is drawn.
+        If True, a 95% bootstrapped confidence interval is drawn.
     truncate_yaxis : bool | str
-        If True, the left y axis spine is truncated to reduce visual clutter.
-        If 'max_ticks', the spine is truncated at the minimum and maximum
-        ticks. Else, it is truncated to half the max absolute value, rounded to
-        .25. Defaults to False.
+        If not False, the left y axis spine is truncated to reduce visual
+        clutter. If 'max_ticks', the spine is truncated at the minimum and
+        maximum ticks. Else, it is truncated to half the max absolute value,
+        rounded to .25. Defaults to "max_ticks".
     truncate_xaxis : bool
         If True, the x axis is truncated to span from the first to the last.
         xtick. Defaults to True.
@@ -2025,7 +2025,7 @@ def plot_compare_evokeds(evokeds, picks=None, gfp=False, colors=None,
         ymax_bound = ax.get_ylim()[-1]
 
     title = _set_title_multiple_electrodes(
-        title, "average" if gfp is False else "gfp", ch_names)
+        title, "average" if gfp is False else "gfp", ch_names, ch_type=ch_type)
     ax.set_title(title)
 
     current_ymin = ax.get_ylim()[0]
diff --git a/mne/viz/utils.py b/mne/viz/utils.py
--- a/mne/viz/utils.py
+++ b/mne/viz/utils.py
@@ -40,6 +40,12 @@
 COLORS = ['b', 'g', 'r', 'c', 'm', 'y', 'k', '#473C8B', '#458B74',
           '#CD7F32', '#FF4040', '#ADFF2F', '#8E2323', '#FF1493']
 
+_channel_type_prettyprint = {'eeg': "EEG channel",  'grad': "Gradiometer",
+                             'mag': "Magnetometer", 'seeg': "sEEG channel",
+                             'eog': "EOG channel", 'ecg': "ECG sensor",
+                             'emg': "EMG sensor", 'ecog': "ECoG channel",
+                             'misc': "miscellaneous sensor"}
+
 
 def _setup_vmin_vmax(data, vmin, vmax, norm=False):
     """Handle vmin and vmax parameters."""
@@ -2510,20 +2516,23 @@ def _check_cov(noise_cov, info):
 
 
 def _set_title_multiple_electrodes(title, combine, ch_names, max_chans=6,
-                                   all=False, ch_type=None, ):
+                                   all=False, ch_type=None):
     """Prepare a title string for multiple electrodes."""
     if title is None:
         title = ", ".join(ch_names[:max_chans])
-        if ch_type is not None:
-            ch_type = " " + ch_type[0].upper() + ch_type[1:]
+        ch_type = _channel_type_prettyprint.get(ch_type, ch_type)
+        if ch_type is None:
+            ch_type = "sensor"
+        if len(ch_names) > 1:
+            ch_type += "s"
         if all is True and isinstance(combine, string_types):
             combine = combine[0].upper() + combine[1:]
-            title = "{} of {}{} sensors".format(
+            title = "{} of {} {}".format(
                 combine, len(ch_names), ch_type)
         elif len(ch_names) > max_chans and combine is not "gfp":
             warn("More than {} channels, truncating title ...".format(
                 max_chans))
-            title += ", ...\n({} of {}{} sensors)".format(
+            title += ", ...\n({} of {} {})".format(
                 combine, len(ch_names), ch_type,)
     return title
 


Test patch: