8000 DOC: switch pylab example `mri_with_eeg.py` to OO interface + cosmetick fixes by afvincent · Pull Request #7192 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

DOC: switch pylab example mri_with_eeg.py to OO interface + cosmetick fixes #7192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace (unfortunate) manual xticks with example of MultipleLocator
  • Loading branch information
afvincent committed Sep 28, 2016
commit 2d65280dfb0b011faca3c2ceedacf8abefd31396
3 changes: 2 additions & 1 deletion examples/pylab_examples/mri_with_eeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import matplotlib.cm as cm

from matplotlib.collections import LineCollection
from matplotlib.ticker import MultipleLocator

# NB: one uses "if 1:" to break up the different regions of code visually
fig = plt.figure("MRI_with_EEG")
Expand All @@ -33,7 +34,7 @@
im = im[np.nonzero(im)] # Ignore the background
im = im / (2**15) # Normalize
ax1.hist(im, 100)
ax1.set_xticks([-1, -0.5, 0, 0.5, 1])
ax1.xaxis.set_major_locator(MultipleLocator(0.5))
ax1.set_yticks([])
ax1.set_xlabel('Intensity')
ax1.set_ylabel('MRI density')
Expand Down
0