Obspy section plot labels

Hi everyone, Coralie,

I wrote something to label active seismic sections with the geophone number for each trace a few time ago. I think you can use the ax.text routine, replacing the following elements if needed:

tr.stats.distance = label distance along (X) axis
1.01 = label distance along (Y) axis (=puts the label 10% above figure)
tr.stats.channel + tr.stats.seg2[‘CHANNEL_NUMBER’] = replace this by your station name

--------------------------------------------------------------------- SCRIPT ---------------------------------------------------------------------

“”" PLOTS SECTION “”"
ax1 = plt.subplot(gs[0])
st.plot(type=‘section’, norm_method=‘trace’, recordlength=1.0,
time_down=True, linewidth=.5, grid_linewidth=.25,
show=False, fig=fig)

“”" ADD LABELS FOR SHOT AND GEOPHONES “”"
for tr in st:
ax1.text(tr.stats.distance, 1.01, tr.stats.channel + tr.stats.seg2[‘CHANNEL_NUMBER’], rotation=90,
va=“bottom”, ha=“center”, transform=transform, zorder=10)
ax1.set_xlim(min_offset, max_offset)
ax1.set_xlabel(’’)