Skip to content

MRG: Unify axis labeling - #5079

Merged
agramfort merged 3 commits into
mne-tools:masterfrom
larsoner:caps
Apr 3, 2018
Merged

agramfort merged 3 commits into
mne-tools:masterfrom
larsoner:caps

Conversation

@larsoner

@larsoner larsoner commented Apr 2, 2018 •

Copy link
Copy Markdown
Member

Closes #4534.

This PR:

  • Unifies axis labeling to "Time (s)" form from others like "time [sec]". Turns out there were a lot of places we already used the former standard so the changeset wasn't so bad.
  • Unifies handling of unit naming in ICA property plots to fit with e.g. raw.plot_psd().
  • Unifies sphx_glr_*-based linking rather than custom tut_ ones to make things more standard.

Comment thread mne/viz/epochs.py
ax.set_title(title)
ax.set_xlim(freqs[0], freqs[-1])
ax.set_xlabel('Frequency (Hz)')
ax.set(ylabel=ylabel, title=title, xlim=(freqs[0], freqs[-1]))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What, this is a thing? I never knew!

Comment thread mne/viz/evoked.py
False, line_alpha=1.)
for ax in axes:
ax.set_xlabel('Time (ms)')
plt.setp(axes, xlabel='Time (ms)')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you want to change all these to 'Time (s)' right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #3164 this is discussed, yes. It's not implemented here, though, and would be better as a follow-up PR if people agree we should do it.

Comment thread mne/viz/ica.py
ax1.plot(times, data_cln.T, color='k')
ax1.set_xlabel('time (s)')
ax1.set_xlim(times[0], times[-1])
ax1.set_xlim(times[0], times[-1])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... what

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed :)

Comment thread mne/viz/misc.py Outdated
sl = slice(0 if fscale == 'linear' else 1, None, None)
axes[2].plot(f[sl], gd[sl], color=color, linewidth=2, zorder=4)
axes[2].set(xlim=flim, ylabel='Group delay (sec)', xlabel='Frequency (Hz)',
axes[2].set(xlim=flim, ylabel='Group delay (s)', xlabel='Frequency (Hz)',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be nicer if you did fig, (time_ax, freq_ax, delay_ax) = plt.subplots(3, squeeze=True) in 754.

@jona-sassenhagen

jona-sassenhagen commented Apr 2, 2018 •

Copy link
Copy Markdown
Contributor

LGTM otherwise

Comment thread mne/viz/misc.py Outdated
@@ -760,7 +756,7 @@ def plot_filter(h, sfreq, freq=None, gain=None, title=None, color='#1f77b4',
f = omega * sfreq / (2 * np.pi)
axes[0].plot(t, h, color=color)
axes[0].set(xlim=t[[0, -1]], xlabel='Time (sec)',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Time (s)

@larsoner

larsoner commented Apr 2, 2018

Copy link
Copy Markdown
Member Author

Comment thread mne/viz/misc.py Outdated
ax.set_xlim(xlim)
ax.set_xlabel('Time (sec)')
ax.set_ylabel('Amplitude (nAm)')
ax.set(xlim=xlim, xlabel='Time (sec)', ylabel='Amplitude (nAm)')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(sec)?

@codecov

codecov Bot commented Apr 3, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #5079 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #5079      +/-   ##
==========================================
- Coverage      88%   87.99%   -0.01%     
==========================================
  Files         356      356              
  Lines       64951    64925      -26     
  Branches    11098    11094       -4     
==========================================
- Hits        57157    57131      -26     
  Misses       4969     4969              
  Partials     2825     2825

@agramfort
agramfort merged commit dba99f1 into mne-tools:master Apr 3, 2018
@agramfort

Copy link
Copy Markdown
Member

thx @larsoner

@larsoner
larsoner deleted the caps branch April 3, 2018 13:36
britta-wstnr pushed a commit to britta-wstnr/mne-python that referenced this pull request Jul 5, 2018
* FIX: Unify axis labeling

* FIX: Cleaner vars

* FIX: Missed a sec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants