Repository: mne-tools/mne-python

Issue:
epoch.plot_image()  for emg channels results in error
### Description of the problem

when epochs.plot_image() is applied to emg channels with default parameters a somewhat cryptic error message is thrown (see Actual results below)


### Steps to reproduce

```Python
epoch.plot_image('some_emg_channel')
```


### Link to data

_No response_

### Expected results

plot with evoked

### Actual results

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)

----> 1 epos.plot_image('other1', vmax =100, vmin=0,evoked=True)

~/site-packages/mne/epochs.py in plot_image(self, picks, sigma, vmin, vmax, colorbar, order, show, units, scalings, cmap, fig, axes, overlay_times, combine, group_by, evoked, ts_args, title, clear)
   1229                    overlay_times=None, combine=None, group_by=None,
   1230                    evoked=True, ts_args=None, title=None, clear=False):
-> 1231         return plot_epochs_image(self, picks=picks, sigma=sigma, vmin=vmin,
   1232                                  vmax=vmax, colorbar=colorbar, order=order,
   1233                                  show=show, units=units, scalings=scalings,

~/site-packages/mne/viz/epochs.py in plot_epochs_image(epochs, picks, sigma, vmin, vmax, colorbar, order, show, units, scalings, cmap, fig, axes, overlay_times, combine, group_by, evoked, ts_args, title, clear)
    326 
    327         # plot the image
--> 328         this_fig = _plot_epochs_image(
    329             this_group_dict['image'], epochs=this_group_dict['epochs'],
    330             picks=picks, colorbar=colorbar, vmin=vmin, vmax=vmax, cmap=cmap,

~/site-packages/mne/viz/epochs.py in _plot_epochs_image(image, style_axes, epochs, picks, vmin, vmax, colorbar, show, unit, cmap, ax, overlay_times, title, evoked, ts_args, combine, combine_given, norm)
    536         pass_combine = (combine if combine_given else None)
    537         _picks = [0] if len(picks) == 1 else None  # prevent applying GFP
--> 538         plot_compare_evokeds({'cond': list(epochs.iter_evoked(copy=False))},
    539                              picks=_picks, axes=ax['evoked'],
    540                              combine=pass_combine, **ts_args)

~/site-packages/mne/viz/evoked.py in plot_compare_evokeds(evokeds, picks, colors, linestyles, styles, cmap, vlines, ci, truncate_yaxis, truncate_xaxis, ylim, invert_y, show_sensors, legend, split_legend, axes, title, show, combine, sphere, time_unit)
   2373         elif isinstance(axes, plt.Axes):
   2374             axes = [axes]
-> 2375             _validate_if_list_of_axes(axes, obligatory_len=len(ch_types))
   2376 
   2377     if len(ch_types) > 1:

~/site-packages/mne/viz/utils.py in _validate_if_list_of_axes(axes, obligatory_len, name)
    253                                      extra='if not None')
    254         if len(axes) != obligatory_len:
--> 255             raise ValueError(
    256                 f'{name} must be an array-like of length {obligatory_len}, '
    257                 f'but the length is {len(axes)}')

ValueError: axes must be an array-like of length 0, but the length is 1


### Additional information

Platform:         Linux-5.4.0-131-generic-x86_64-with-glibc2.31
Python:           3.9.7 (default, Sep 16 2021, 13:09:58)  [GCC 7.5.0]
CPU:              x86_64: 8 cores
mne:              1.2.1
numpy:            1.21.2 {MKL 2021.4-Product with 4 threads}
scipy:            1.7.1
matplotlib:       3.4.3 {backend=module://matplotlib_inline.backend_inline}

sklearn:          1.0.1
cupy:             8.3.0
pandas:           1.3.4
qtpy:             1.10.0 {PyQt5=5.9.7}
pooch:            v1.6.0


Discussion:
Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽‍♂️


Resolving patch:
diff --git a/mne/viz/evoked.py b/mne/viz/evoked.py
--- a/mne/viz/evoked.py
+++ b/mne/viz/evoked.py
@@ -2335,7 +2335,7 @@ def plot_compare_evokeds(evokeds, picks=None, colors=None,
     # some things that depend on picks:
     ch_names = np.array(one_evoked.ch_names)[picks].tolist()
     ch_types = [t for t in _get_channel_types(info, picks=picks, unique=True)
-                if t in _DATA_CH_TYPES_SPLIT + ('misc',)]  # miscICA
+                if t in _DATA_CH_TYPES_SPLIT + ('misc', 'emg')]  # miscICA
     picks_by_type = channel_indices_by_type(info, picks)
     # discard picks from non-data channels (e.g., ref_meg)
     good_picks = sum([picks_by_type[ch_type] for ch_type in ch_types], [])


Test patch:
diff --git a/mne/viz/tests/test_epochs.py b/mne/viz/tests/test_epochs.py
--- a/mne/viz/tests/test_epochs.py
+++ b/mne/viz/tests/test_epochs.py
@@ -305,6 +305,14 @@ def test_plot_epochs_image(epochs):
     plt.close('all')
 
 
+def test_plot_epochs_image_emg():
+    """Test plotting epochs image with EMG."""
+    info = create_info(['EMG 001'], sfreq=100, ch_types='emg')
+    data = np.ones((2, 1, 10))
+    epochs = EpochsArray(data=data, info=info)
+    epochs.plot_image('EMG 001', ts_args={"show_sensors": False})
+
+
 def test_plot_drop_log(epochs_unloaded):
     """Test plotting a drop log."""
     with pytest.raises(ValueError, match='bad epochs have not yet been'):