New example: spectrum with percentiles
The summary pages regularly display ASDs with 5/95th percentiles shaded on either side of the median, this would make a nice example in the docs. The following simple example should work with minimal changes:
#!/usr/bin/env python
"""Generate a plot of a median spectrum, with 5th and 95th percentiles
"""
from matplotlib import use
use('agg')
from gwpy.timeseries import TimeSeries
from gwpy.plotter import FrequencySeriesPlot
channel = 'H1:GDS-CALIB_STRAIN'
ft = 'H1_HOFT_C00'
start = 'July 12 05:30'
end = 'July 12 06:00'
# get data
ts = TimeSeries.get(channel, start, end, verbose=True, frametype=ft, nproc=4)
# make spectrogram
sg = ts.spectrogram(60, 4, 2, window=('kaiser', 24)) ** (1/2.)
# extract median, 5th and 95th percentiles
a = sg.percentile(50)
b = sg.percentile(5)
c = sg.percentile(95)
# make plot
plot = FrequencySeriesPlot()
ax = plot.gca()
ax.plot_spectrum_mmm(a, b, c, label=None)
ax.set_xscale('log')
ax.set_yscale('log')
ax.set_xlim(10, 4000)
ax.set_ylim(5e-24,1e-19)
plot.save('mmm.png')