gwpy.plotter
)¶Visualisation of the data produced by gravitational-wave detectors is
obviously a key part of understanding their sensitivity, and studying the
potential gravitational-wave signals they record.
The gwpy.plotter
module provides a number of plot classes, each
representing display of a corresponding data type.
The majority of core data objects in GWpy come with a built-in plot()
method, allowing quick display of a single data set, for example:
>>> from gwpy.timeseries import TimeSeries
>>> h1 = TimeSeries.fetch_open_data('H1', 1126259457, 1126259467)
>>> plot = h1.plot()
>>> plot.show()
(png)
Users can also import the relevant plotting class
objects and generate
more complicated plots manually:
>>> l1 = TimeSeries.fetch_open_data('L1', 1126259457, 1126259467)
>>> from gwpy.plotter import TimeSeriesPlot
>>> plot = TimeSeriesPlot()
>>> ax = plot.gca()
>>> ax.plot(h1, color='gwpy:ligo-hanford')
>>> ax.plot(l1, color='gwpy:ligo-livingston')
>>> ax.set_ylabel('Strain noise')
>>> plot.show()
(png)