Repository: mne-tools/mne-python

Issue:
ica.plot_properties only plots 3 epochs with raw input?
Try:

```
import mne
path_eeglab = mne.datasets.testing.data_path()

fname = path_eeglab + '/EEGLAB/test_raw.set'
montage = path_eeglab + "/EEGLAB/test_chans.locs"

event_id = {"rt": 1, "square": 2}
raw = mne.io.read_raw_eeglab(fname, event_id=event_id, preload=True, montage=montage)
ica = mne.preprocessing.ICA(20, random_state=0).fit(raw.filter(1, None))
ica.plot_properties(raw, 0)
```

Gives:

<img width="491" alt="unknown-191" src="https://user-images.githubusercontent.com/4321826/43680492-68ce6a04-983c-11e8-9b40-79552bc99cb3.png">

I.e., for some reason, only 3 "epochs" are plotted.

@mmagnuski 


Discussion:
I can replicate the pb.

I can replicate the problem too.
But it gets even weirder for me: each time I restart the notebook I get different axes filled with spectrum, epoch variance, etc. Below three examples:  

<img width="300" alt="01" src="https://user-images.githubusercontent.com/8452354/43684373-30716c0c-989f-11e8-9a84-ba87977cce6f.PNG">
<img width="300" alt="02" src="https://user-images.githubusercontent.com/8452354/43684374-330391d4-989f-11e8-82aa-9ce1f770ffef.PNG">
<img width="300" alt="03" src="https://user-images.githubusercontent.com/8452354/43684378-362171ce-989f-11e8-92e6-dd4e1cff2476.PNG">

I currently have no other explanation than that your code is haunted...
I would try with an older matplotlib so see if we broke it or they did.

Hm ... The axes are created here, and later unpacked order:

```
def _create_properties_layout(figsize=None):
    """Create main figure and axes layout used by plot_ica_properties."""
    import matplotlib.pyplot as plt
    if figsize is None:
        figsize = [7., 6.]
    fig = plt.figure(figsize=figsize, facecolor=[0.95] * 3)

    axes_params = {'topomap': [0.08, 0.5, 0.3, 0.45],
                   'image': [0.5, 0.6, 0.45, 0.35],
                   'erp': [0.5, 0.5, 0.45, 0.1],
                   'spectrum': [0.08, 0.1, 0.32, 0.3],
                   'variance': [0.5, 0.1, 0.45, 0.25]}
    axes = [fig.add_axes(pos, label=name) for name, pos in axes_params.items()]

    return fig, axes
```

Dict order should be fixed in Py3.6+, but is not guaranteed otherwise right?

Which would however not explain why it does not work on my Py3.6 either.
(Also I think I wrote that code :()
@jona-sassenhagen Yes, you changed that part some time ago, and you made it more elegant and definitely more exciting. :) But that still doesn't explain the strange 2-epoch like imageplot. Maybe that's just an issue of setting y limits?

Resolving patch:
diff --git a/mne/viz/ica.py b/mne/viz/ica.py
--- a/mne/viz/ica.py
+++ b/mne/viz/ica.py
@@ -117,12 +117,12 @@ def _create_properties_layout(figsize=None):
         figsize = [7., 6.]
     fig = plt.figure(figsize=figsize, facecolor=[0.95] * 3)
 
-    axes_params = {'topomap': [0.08, 0.5, 0.3, 0.45],
-                   'image': [0.5, 0.6, 0.45, 0.35],
-                   'erp': [0.5, 0.5, 0.45, 0.1],
-                   'spectrum': [0.08, 0.1, 0.32, 0.3],
-                   'variance': [0.5, 0.1, 0.45, 0.25]}
-    axes = [fig.add_axes(pos, label=name) for name, pos in axes_params.items()]
+    axes_params = (('topomap', [0.08, 0.5, 0.3, 0.45]),
+                   ('image', [0.5, 0.6, 0.45, 0.35]),
+                   ('erp', [0.5, 0.5, 0.45, 0.1]),
+                   ('spectrum', [0.08, 0.1, 0.32, 0.3]),
+                   ('variance', [0.5, 0.1, 0.45, 0.25]))
+    axes = [fig.add_axes(loc, label=name) for name, loc in axes_params]
 
     return fig, axes
 
@@ -349,7 +349,7 @@ def set_title_and_labels(ax, title, xlab, ylab):
 
         # the actual plot
         fig = _plot_ica_properties(
-            pick, ica, inst, psds_mean, freqs, len(picks),
+            pick, ica, inst, psds_mean, freqs, ica_data.shape[1],
             np.var(ica_data[idx], axis=1), plot_lowpass_edge,
             epochs_src, set_title_and_labels, plot_std, psd_ylabel,
             spectrum_std, topomap_args, image_args, fig, axes)


Test patch: