Repository: mne-tools/mne-python

Issue:
plotting bug with `plot_components` with EEG montage
I am currently working with some biosemi data and I noticed one bug and one enhancement that should be addressed before the release.

the first is the bug: when plotting the IC for the EEG data, only one topo plot is currently being plotted while the rest are left empty.

![figure_1](https://cloud.githubusercontent.com/assets/1578674/7339415/bc648712-ec3b-11e4-8c5a-f645092ad2c5.png)

the second is a feature enhancement: when using `ica.plot_components`, the plotting function should not default to `meg` especially when there are no meg channels present in the data. the default ch_type should be None. we should inspect the channel types, and if there are no meg channels, we should plot the EEG, if we have meg only, then plot meg, then if we have both, probably the default should be meg but that can be discussed.



Discussion:
bug fix yes, enhancement time is over. please noe new ENH requests.

@teonlamont I'm plotting ICs for EEG data almost every day. Can you share a snippet of code to reproduce this?

it's a backend pb I suspect. Try starting ipython with --gui=qt or
something along these lines

how do you do that from a PC...? lol

@teonlamont what do you mean? On a PC ipython is supposed to work.

with the flag --gui=qt. there's a separate application that is loaded for ipython

@teonlamont with anaconda there should be a linux terminal emulator.

ok, @dengemann, I will make a separate issue for the `ch_type`. i think it would be a broader plotting feature to look at for any plot that requires a ch_type as input.

>  i think it would be a broader plotting feature to look at for any plot that requires a ch_type as input.

yes, I suggested that already a few times during seprate discussions. We should implement it once, carefully and consistently.

@dengemann I will give it a look tomorrow and report back wrt to the linux terminal emulator. I just left the lab. I didn't know if it was our problem or a backend one.

> yes, I suggested that already a few times during seprate discussions. We should implement it once, carefully and consistently.

yeah, I remembered it being discussed and i had thought it had been addressed.

open an issue and we'll re-discuss it.


Resolving patch:
diff --git a/mne/viz/topomap.py b/mne/viz/topomap.py
--- a/mne/viz/topomap.py
+++ b/mne/viz/topomap.py
@@ -692,7 +692,7 @@ def plot_ica_components(ica, picks=None, ch_type='mag', res=64,
         im = plot_topomap(data_.flatten(), pos, vmin=vmin_, vmax=vmax_,
                           res=res, axis=ax, cmap=cmap, outlines=outlines,
                           image_mask=image_mask, contours=contours,
-                          image_interp=image_interp)[0]
+                          image_interp=image_interp, show=False)[0]
         if colorbar:
             divider = make_axes_locatable(ax)
             cax = divider.append_axes("right", size="5%", pad=0.05)
@@ -871,7 +871,7 @@ def plot_tfr_topomap(tfr, tmin=None, tmax=None, fmin=None, fmax=None,
 
     im, _ = plot_topomap(data[:, 0], pos, vmin=vmin, vmax=vmax,
                          axis=ax, cmap=cmap, image_interp='bilinear',
-                         contours=False, names=names)
+                         contours=False, names=names, show=False)
 
     if colorbar:
         divider = make_axes_locatable(ax)
@@ -1151,7 +1151,8 @@ def _plot_topomap_multi_cbar(data, pos, ax, title=None, unit=None,
     if title is not None:
         ax.set_title(title, fontsize=10)
     im, _ = plot_topomap(data, pos, vmin=vmin, vmax=vmax, axis=ax,
-                         cmap=cmap, image_interp='bilinear', contours=False)
+                         cmap=cmap, image_interp='bilinear', contours=False,
+                         show=False)
 
     if colorbar is True:
         divider = make_axes_locatable(ax)


Test patch: