Plot single event waveform

Hi all,

I have events that I whant to plot in picture as single events inserting some info in picture, like as info that I can insert in events picture when I creating a one-day plot with type parameter = , ‘dayplot’.

I have try to do that, but I’m managed only to plot wave with only station code inserted in picture. I’m try to add other info like star to initial position with time on P and S, or, best, add a little side baloon with principal info (P, S, Mag and so othe info to insert in)

Regards,

Sergio

Hi Sergio,

not sure what exactly you're trying to do but I think this should get
you started:

"""
import matplotlib.pyplot as plt
from obspy import read

st = read()
fig = st.plot(show=False, handle=True, automerge=False)

tr = st[0]
ax = fig.axes[0]

# do whatever custom matplotlib plotting you want here:
t = tr.stats.starttime + 4.0
ax.axvline(t.datetime, color='r', lw=2)

plt.show()
"""

The main point is just to use "t.datetime" as x variable for the plots
so that matplotlib correctly matches the time info..

hope it helps,
T

Hi Tobias,

I whant to plot an event like the attached image.
As you can see, in the up left of the screen there is the station name.
I have look in trace, and I have found in the first index [0] these value:

IV.ASSB..HHE | 2017-07-22T02:13:00.004400Z - 2017-07-22T02:23:51.344400Z

100.0 Hz, 65135 samples

I have think to add info before the first field '|' separed, but an error occour and do not plot.
I haven't understand your example.

Can you help me or explain the example?

Cheers

Sergio

IV.ASSB.HHE.png

Hi Sergio,

I think you should start with some basic Python/ObsPy and matplotlib
tutorials.
For ObsPy introductions we have some material up in our docs:

http://docs.obspy.org/master/tutorial/index.html

And there's also a youtube 1-hour intro from 2015:

https://www.youtube.com/watch?v=kFwdjfiK4gk

and some newer screencasts from 2016:

https://www.youtube.com/playlist?list=PLdy04DoEepExAlSenP_jlczYsFsYwp3zm

For matplotlib a good starting point is the gallery, where you can check
out how to get individual plotting jobs done:

http://matplotlib.org/gallery.html

hope it helps,

T

Hi Tobias,

I have read lot about obspy, but I have encountered some difficulties about matplotlib.

I’m sorry, but I think that I will settle with that I know

Best regards,

Sergio