Axes limit in stream plot in obspy python

Viewed 161

I want to plot multiple data (some days) all in one figure. Then I would like to change the axes limit and title and so on. The problem is that the axes property applies only to the box of the figure and does not apply to the data itself. Does anybody have an idea how to get the right figure? Here is the code I use:

st=obspy.read('Z7*')
fig, ax = plt.subplots(figsize=(14, 4))
ax.set_ylim(0,0.01)
ax.set_xlabel("My x label")
st.plot(fig=fig, color='blue')

And the result is here: enter image description here

I have a second question too. Here I am reading all the files in the folder starting with special characters. How can I read some of them? I mean is there any way to give the name of some data to read them only?

1 Answers

Ok, I just figure it out. We should use Matplotlib in the bellow format. In this way, all the axes setting in the Matplotlib will work.

t1=UTCDateTime('2014, 8, 14, 12, 00, 00')
t2=UTCDateTime('2014, 8, 31, 12, 00, 00')
st = read('Z7*', starttime=t1, endtime=t2)
st.merge(method=1, fill_value='interpolate')
plt.plot(st[0])
Related