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
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps move this to the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good points - fixed them.
@anntzer I swapped the plots around for aesthetic reasons: The minus signs in the y-axis changes the position of the y-labels. |
|
||
plt.subplot(3, 2, 6) | ||
plt.phase_spectrum(s, Fs=Fs) | ||
# plot different spectrum types: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be worth giving them titles / axis labels?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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)
Thanks @vollbier ! This is so much better! |
Fixes eighth entry in issue #7956