Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fix layout of spectrum_demo.py #8158
Conversation
|
| -plt.subplot(3, 2, 4) | ||
| -plt.magnitude_spectrum(s, Fs=Fs, scale='dB') | ||
| +fig, axx = plt.subplots(3, 2) |
phobson
Feb 27, 2017
Member
I see what you're doing here. But I think we should strive for consistency in the examples/gallery.
In my mind that means, for a single axes object:
fig, ax = plt.subplots()And for multiples axes:
fig, axes = plt.subplots(ncols=C, nrows=R)| +# plot different spectrum types: | ||
| +axx[1, 0].magnitude_spectrum(s, Fs=Fs) | ||
| +axx[2, 0].phase_spectrum(s, Fs=Fs) | ||
| +axx[0, 1].remove() # don't display empty ax |
|
@anntzer I swapped the plots around for aesthetic reasons: The minus signs in the y-axis changes the position of the y-labels. $t$ and $s(t)$ are removed. |
| -plt.subplot(3, 2, 6) | ||
| -plt.phase_spectrum(s, Fs=Fs) | ||
| +# plot different spectrum types: |
phobson
Mar 1, 2017
•
Member
@vollbier sorry to move the goal post on you.
In addition to Tom's request could you:
- make the figure bigger (add
figsize=(7, 7)to the call tosubplots)
2) make the Magnitude y-axis log-scaled (if that's appropriate for the domain)
vollbier
Mar 1, 2017
Contributor
I added titles, but I think it's worthwhile leaving the default axis labels, since it's feature of the spectrum functions.
| -plt.subplot(3, 2, 6) | ||
| -plt.phase_spectrum(s, Fs=Fs) | ||
| +# plot different spectrum types: |
phobson
Mar 1, 2017
•
Member
@vollbier sorry to move the goal post on you.
In addition to Tom's request could you:
- make the figure bigger (add
figsize=(7, 7)to the call tosubplots)
2) make the Magnitude y-axis log-scaled (if that's appropriate for the domain)
phobson
changed the title from
Fix layout of spectrum_demo.py to [MRG+1] Fix layout of spectrum_demo.py
Mar 3, 2017
NelleV
merged commit a8547fa
into matplotlib:master
Mar 6, 2017
5 checks passed
|
Thanks @vollbier ! This is so much better! |
vollbier commentedFeb 26, 2017
Fixes eighth entry in issue #7956