Plotting several traces in one plot

Dear obspy-ers

I was wondering whether we could plot all traces in a stream on one
plot. I would like to have traces contained in a stream plotted in one

Thank you in advance for any suggestion and help



Dear Makky,

did you try to use the parameter automerge=True ?
for details.

If you want to plot several traces of different seed ids in one axes
its probably better to create your own custom matplolib plot. A very
basic one:
import pylab as plt
imort numpy as np
for tr in stream:

Hope it helps,

To follow up with some basic plotting tips:

- if you want time stamps on y axes try something like..

import matplotlib.pyplot as plt
from matplotlib.dates import date2num
start = date2num(tr.stats.starttime)
end = date2num(tr.stats.endtime)
times = np.linspace(start, end, tr.stats.npts)
plt.plot_date(times,, "r-")

- another helper function on figure objects is helpful

fig = plt.figure()
# plotting here

- one more thing: you actually *can* maybe use obspy's preview plot to
plot several different channels on top of each (i did a simple plot
like this some days ago) other but you might run into limitations
pretty fast.. (e.g. all follow up plots need to have same number of

from obspy import read
import matplotlib.pyplot as plt

st = read()
fig = plt.figure()
for comp, color in zip(["N", "Z"], ["r", "k"]):
    st_ =
    st_.plot(show=False, fig=fig, color=color,
plt.title("My own title")


P.S.: Maybe somebody should add some basic tips for matplotlib ploting
in the tutorial plotting section after the preview plot examples..

Dear Makky,

did you try to use the parameter automerge=True ? See

for details.