Repository: mne-tools/mne-python

Issue:
BUG: #6942 leads to corrupted plot
#### Describe the bug
The output of `test_plot_evoked_image` in [test_evoked.py](https://github.com/mne-tools/mne-python/blob/master/mne/viz/tests/test_evoked.py) produces an erroneous plot after #6942 (#6930).
Data appear to be shifted upwards in the upper plot.

![test_plot_evoked_image_issue](https://user-images.githubusercontent.com/20129752/66550247-45554e00-eb45-11e9-9f5f-c78a8e0e0d90.png)


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
@@ -585,9 +585,9 @@ def _plot_image(data, ax, this_type, picks, cmap, unit, units, scalings, times,
         vmin=vmin, vmax=vmax, mask_style=mask_style, mask_alpha=mask_alpha,
         mask_cmap=mask_cmap)
 
+    # ignore xlim='tight'; happens automatically with `extent` in imshow
+    xlim = None if xlim == 'tight' else xlim
     if xlim is not None:
-        if xlim == 'tight':
-            xlim = (times[0], times[-1])
         ax.set_xlim(xlim)
 
     if colorbar:
@@ -596,22 +596,16 @@ def _plot_image(data, ax, this_type, picks, cmap, unit, units, scalings, times,
         if cmap[1]:
             ax.CB = DraggableColorbar(cbar, im)
 
-    ylabel = "Channels" if show_names else 'Channel (index)'
+    ylabel = 'Channels' if show_names else 'Channel (index)'
     t = titles[this_type] + ' (%d channel%s' % (len(data), _pl(data)) + t_end
     ax.set(ylabel=ylabel, xlabel='Time (%s)' % (time_unit,), title=t)
     _add_nave(ax, nave)
 
-    if show_names is not False:
-        if show_names == "all":
-            yticks = np.arange(len(picks)).astype(int)
-            yticklabels = np.array(ch_names)[picks]
-        else:
-            max_tick = len(picks)
-            yticks = [tick for tick in ax.get_yticks() if tick < max_tick]
-            yticks = np.array(yticks).astype(int)
-            # these should only ever be ints right?
-            yticklabels = np.array(ch_names)[picks][yticks]
-        ax.set(yticks=yticks + .5, yticklabels=yticklabels)
+    yticks = np.arange(len(picks))
+    if show_names != 'all':
+        yticks = np.intersect1d(np.round(ax.get_yticks()).astype(int), yticks)
+    yticklabels = np.array(ch_names)[picks] if show_names else np.array(picks)
+    ax.set(yticks=yticks, yticklabels=yticklabels[yticks])
 
 
 @verbose
@@ -939,14 +933,13 @@ def plot_evoked_image(evoked, picks=None, exclude='bads', unit=True,
         The units for the time axis, can be "ms" or "s" (default).
 
         .. versionadded:: 0.16
-    show_names : bool | str
+    show_names : bool | 'auto' | 'all'
         Determines if channel names should be plotted on the y axis. If False,
-        no names are shown. If True, ticks are set automatically and the
-        corresponding channel names are shown. If str, must be "auto" or "all".
-        If "all", all channel names are shown.
-        If "auto", is set to False if `picks` is ``None``; to ``True`` if
-        `picks` is not ``None`` and fewer than 25 picks are shown; to "all"
-        if `picks` is not ``None`` and contains fewer than 25 entries.
+        no names are shown. If True, ticks are set automatically by matplotlib
+        and the corresponding channel names are shown. If "all", all channel
+        names are shown. If "auto", is set to False if `picks` is ``None``,
+        to ``True`` if ``picks`` contains 25 or more entries, or to "all"
+        if ``picks`` contains fewer than 25 entries.
     group_by : None | dict
         If a dict, the values must be picks, and `axes` must also be a dict
         with matching keys, or None. If `axes` is None, one figure and one axis


Test patch: