All of that you can do with matplotlib API on the Figure and Axes object, but to be honest, at this point, you’re better of to just start making custom plots yourself with matplotlib, I’d say. Stream.plot() is intended as a quick preview but it just can’t accommodate every need.
To get you started..
from obspy import read
import matplotlib.pyplot as plt
st = read()
fig, axes = plt.subplots(nrows=len(st), sharex=True)
for tr, ax in zip(st, axes):
times = tr.times('matplotlib')
ax.plot(times, tr.data)
ax.xaxis_date()
fig.autofmt_xdate()
# could als use ObsPyAutoDateFormatter on x Axis
plt.show()
I really believe you will find it easier to start simple and then add things as you move forward rather then taking that ready made plot and try to poke around in its intestines to make adjustments.
Matplotlib really has good documentation on anything you want to add to your plot.
Regarding removing the “lines between subplots”, spines is what that is called, so look there for how to do it.
Something like this, probably:
axes[0].spines.bottom.set_visible(False)
axes[-1].spines.top.set_visible(False)
for ax in axes[1:-1]:
ax.spines.bottom.set_visible(False)
ax.spines.top.set_visible(False)
from obspy import read
import matplotlib.pyplot as plt
st = read()
fig, axes = plt.subplots(nrows=len(st), sharex=True)
for tr, ax in zip(st, axes):
times = tr.times('matplotlib')
ax.plot(times, tr.data)
ax.xaxis_date()
fig.autofmt_xdate()
# could also use ObsPyAutoDateFormatter on x Axis
plt.subplots_adjust(hspace=0)
axes[0].spines.bottom.set_visible(False)
axes[-1].spines.top.set_visible(False)
for ax in axes[1:-1]:
ax.spines.bottom.set_visible(False)
ax.spines.top.set_visible(False)
plt.show()