Skip to content

Commit

Permalink
FIX: Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Dec 20, 2016
1 parent f0d78dd commit 2e193dd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ dependencies:
else
echo "Conda already set up.";
fi
- conda install -n circleenv --yes numpy scipy scikit-learn matplotlib sphinx=1.4.1 pillow six IPython pandas apptools=4.4.0 envisage=4.5.1 pyface=5.1.0 traits=4.6.0 traitsui=5.1.0 vtk=5.10.1;
- pip install mayavi==4.4.4;
# Let's use old Mayavi because 4.5.0 (as of 2016/12/20) breaks plot_mne_inverse_coherence_epochs.py
- conda install -n circleenv --yes numpy scipy scikit-learn matplotlib sphinx pillow six IPython pandas mayavi vtk;
- ls -al /home/ubuntu/miniconda;
- ls -al /home/ubuntu/miniconda/bin;
- echo $PATH;
Expand Down
19 changes: 8 additions & 11 deletions mne/viz/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,28 +108,25 @@ def plot_cov(cov, info, exclude=[], colorbar=True, proj=False, show_svd=True,

import matplotlib.pyplot as plt

fig_cov, axes = plt.subplots(1, len(idx_names),
fig_cov, axes = plt.subplots(1, len(idx_names), squeeze=False,
figsize=(2.5 * len(idx_names), 2.7))
if isinstance(axes, plt.Axes):
axes = [axes]
for k, (idx, name, _, _) in enumerate(idx_names):
axes[k].imshow(C[idx][:, idx], interpolation="nearest", cmap='RdBu_r')
axes[k].set(title=name)
axes[0, k].imshow(C[idx][:, idx], interpolation="nearest",
cmap='RdBu_r')
axes[0, k].set(title=name)
fig_cov.subplots_adjust(0.04, 0.0, 0.98, 0.94, 0.2, 0.26)
tight_layout(fig=fig_cov)

fig_svd = None
if show_svd:
fig_svd, axes = plt.subplots(1, len(idx_names))
if isinstance(axes, plt.Axes):
axes = [axes]
fig_svd, axes = plt.subplots(1, len(idx_names), squeeze=False)
for k, (idx, name, unit, scaling) in enumerate(idx_names):
s = linalg.svd(C[idx][:, idx], compute_uv=False)
# Protect against true zero singular values
s[s <= 0] = 1e-10 * s[s > 0].min()
axes[k].semilogy(np.sqrt(s) * scaling)
axes[k].set(ylabel='Noise std (%s)' % unit,
xlabel='Eigenvalue index', title=name)
axes[0, k].semilogy(np.sqrt(s) * scaling)
axes[0, k].set(ylabel='Noise std (%s)' % unit,
xlabel='Eigenvalue index', title=name)
tight_layout(fig=fig_svd)

plt_show(show)
Expand Down
1 change: 1 addition & 0 deletions tutorials/plot_brainstorm_auditory.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
http://neuroimage.usc.edu/brainstorm/Tutorials/Auditory
Experiment:
- One subject, 2 acquisition runs 6 minutes each.
- Each run contains 200 regular beeps and 40 easy deviant beeps.
- Random ISI: between 0.7s and 1.7s seconds, uniformly distributed.
Expand Down

0 comments on commit 2e193dd

Please sign in to comment.