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
Respect method='full'
for Stream.plot(type='section')
#3379
Respect method='full'
for Stream.plot(type='section')
#3379
Conversation
Parallels the logic implemented in the `WaveformPlotting.plot()` method
Demo: from obspy import read
import matplotlib.pyplot as plt
import numpy as np
# Read in example data
st = read()
# Pretend that the three components are actually traces
# from different stations at 10, 20, 30 km from source
for tr, distance in zip(st, [10 * 1000, 20 * 1000, 30 * 1000]):
tr.stats.distance = distance # [m]
# Artifically increase the number of points in each trace to exceed max_npts
# (this makes the resampling for 'fast' clear)
for tr in st:
tr.data = np.tile(tr.data, 20)
# Plot record section
fig = plt.figure()
st.plot(fig=fig, type='section', orientation='horizontal', method='fast', alpha=1, color='red')
st.plot(fig=fig, type='section', orientation='horizontal', method='full', alpha=1)
fig.axes[0].set_xlim(5, 10) # Zoom in to show effect of the different plotting methods
fig.show() |
seems like a nice fix! i think you may have to rebase to the current maintenance branch though |
Sorry, I don't understand. The current maintenance branch is |
ahh you're right sorry! i have lost track of the passage of time between versions. |
Hi folks, just checking if there is more feedback on this PR. Thanks. |
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.
looks good to me and tested fine on my machine
Great! Looks like this is ready to be merged, then? I can't do that part :) |
sorry for the delay @liamtoney.. looks good to me, just two comments:
Would be nice to still get 1. in here, but 2. could be something for a different PR / another time. |
Are you referring to the fact that the section plot resamples the data while the standard plot does the min/max? Maybe a separate PR for that? |
Nice test idea! I implemented that and am ready for re-review, I think. |
Yes, I was assuming it was doing the same min-max thing we have for the regular wiggle plot and was confused why the line was overshooting in some points and stuff. And yes, definitely something for another time, if at all. It's not a big deal really. |
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.
Thanks for the fix! 🚀
What does this PR do?
For section-type plots: Ensures that the full Trace is plotted when a user requests it to be (i.e., when specifying
method='full'
). Parallels the logic implemented in theWaveformPlotting.plot()
method.Why was it initiated? Any relevant Issues?
Fixes #3375.
PR Checklist
master
for new features,maintenance_...
for bug fixesno_ci
label can be added to skip CI buildsJust add the
build_docs
tag to this PR.Docs will be served at docs.obspy.org/pr/{branch_name} (do not use master branch).
Please post a link to the relevant piece of documentation.
clients.fdsn
) should be tested for the PR,just add the
test_network
tag to this PR.CHANGELOG.txt
.CONTRIBUTORS.txt
.from all the CI builds look correct. Add the "upload_plots" tag so that plotting
outputs are attached as artifacts.
CODEOWNERS
with your github handleready for review
label when you are ready for the PR to be reviewed.