This document provides a reference for the following Figure
class
objects:
Plot |
An extension of the core matplotlib Figure . |
TimeSeriesPlot |
Figure for displaying a TimeSeries . |
FrequencySeriesPlot |
Figure for displaying a FrequencySeries |
SpectrogramPlot |
Figure for displaying a Spectrogram . |
SegmentPlot |
Figure for displaying a DataQualityFlag . |
EventTablePlot |
Figure for displaying a Table . |
BodePlot |
A Plot class for visualising transfer functions. |
and the following Axes
class
objects:
Axes |
An extension of the core matplotlib Axes . |
TimeSeriesAxes |
Custom Axes for a TimeSeriesPlot . |
FrequencySeriesAxes |
Custom Axes for a FrequencySeriesPlot . |
SegmentAxes |
Custom Axes for a SegmentPlot . |
EventTableAxes |
Custom Axes for an EventTablePlot . |
Figure
objects¶Each of the below classes represents a figure object; for brevity inherited methods and attributes are not documented here, please follow links to the parent classes for documentation of available methods and attributes.
gwpy.plotter.
Plot
(*args, **kwargs)[source]¶Bases: matplotlib.figure.Figure
An extension of the core matplotlib Figure
.
The Plot
provides a number of methods to simplify generating
figures from GWpy data objects, and modifying them on-the-fly in
interactive mode.
Attributes Summary
logx |
View x-axis in logarithmic scale |
logy |
View y-axis in logarithmic scale |
title |
title for the current axes |
xlabel |
x-axis label for the current axes |
xlim |
x-axis limits for the current axes |
ylabel |
y-axis label for the current axes |
ylim |
y-axis limits for the current axes |
Methods Summary
add_array (artist, *args, **kwargs) |
Add a Array to this plot |
add_colorbar (artist, *args, **kwargs) |
Add a colorbar to the current Axes |
add_dataqualityflag (flag[, projection, ax, ...]) |
Add a DataQualityFlag to this plot |
add_frequencyseries (artist, *args, **kwargs) |
Add a FrequencySeries trace to this plot |
add_image (artist, *args, **kwargs) |
Add a 2-D image to this plot |
add_legend (artist, *args, **kwargs) |
Add a legend to this Plot on the most favourable Axes |
add_line (artist, *args, **kwargs) |
Add a line to the current plot |
add_scatter (artist, *args, **kwargs) |
Add a set or points to the current plot |
add_spectrogram (artist, *args, **kwargs) |
Add a Spectrogram trace to |
add_spectrum (artist, *args, **kwargs) |
Add a FrequencySeries trace to this plot |
add_subplot (*args, **kwargs) |
Add a subplot. |
add_timeseries (artist, *args, **kwargs) |
Add a TimeSeries trace to this plot |
close () |
Close the plot and release its memory. |
get_auto_refresh () |
Return this `Plot`s auto-refresh setting |
get_axes ([projection]) |
Find all Axes , optionally matching the given projection |
get_title (figure, *args, **kwargs) |
Get an axes title. |
get_xlabel (figure, *args, **kwargs) |
Get the xlabel text string. |
get_xlim (figure, *args, **kwargs) |
Get the x-axis range [left, right] |
get_xscale (figure, *args, **kwargs) |
Return the xaxis scale string: linear, log, logit, symlog |
get_ylabel (figure, *args, **kwargs) |
Get the ylabel text string. |
get_ylim (figure, *args, **kwargs) |
Get the y-axis range [bottom, top] |
get_yscale (figure, *args, **kwargs) |
Return the yaxis scale string: linear, log, logit, symlog |
html_map (figure, *args, **kwargs) |
Create an HTML map for some data contained in these Axes |
refresh () |
Refresh the current figure |
save (*args, **kwargs) |
Save the figure to disk. |
set_auto_refresh (b) |
Set this `Plot`s auto-refresh setting |
set_title (artist, *args, **kwargs) |
Set a title for the axes. |
set_xlabel (figure, *args, **kwargs) |
Set the label for the xaxis. |
set_xlim (artist, *args, **kwargs) |
Call signature: |
set_xscale (artist, *args, **kwargs) |
Call signature: |
set_ylabel (artist, *args, **kwargs) |
Set the label for the yaxis |
set_ylim (artist, *args, **kwargs) |
Call signature: |
set_yscale (artist, *args, **kwargs) |
Call signature: |
show ([block, warn]) |
Display the current figure (if possible) |
Attributes Documentation
logx
¶View x-axis in logarithmic scale
logy
¶View y-axis in logarithmic scale
title
¶title for the current axes
xlabel
¶x-axis label for the current axes
xlim
¶x-axis limits for the current axes
ylabel
¶y-axis label for the current axes
ylim
¶y-axis limits for the current axes
Methods Documentation
add_array
(artist, *args, **kwargs)[source]¶Add a Array
to this plot
Parameters: | array :
projection : ax : newax :
**kwargs :
|
---|---|
Returns: | Artist :
|
add_colorbar
(artist, *args, **kwargs)[source]¶Add a colorbar to the current Axes
Parameters: | mappable : matplotlib data collection
ax :
location :
width :
pad :
log :
label :
clim : pair of floats, optional
visible :
**kwargs :
|
---|---|
Returns: | Colorbar :
|
add_dataqualityflag
(flag, projection=None, ax=None, newax=False, sharex=None, sharey=None, **kwargs)[source]¶Add a DataQualityFlag
to this plot
Parameters: | flag :
|
---|
add_frequencyseries
(artist, *args, **kwargs)[source]¶Add a FrequencySeries
trace to this plot
Parameters: | spectrum :
projection :
ax : newax :
**kwargs :
|
---|---|
Returns: | Line2D :
|
add_image
(artist, *args, **kwargs)[source]¶Add a 2-D image to this plot
Parameters: | image :
**kwargs :
|
---|---|
Returns: | image : |
add_legend
(artist, *args, **kwargs)[source]¶Add a legend to this Plot
on the most favourable Axes
All non-keyword args
and kwargs
are passed directly to the
legend()
generator
Returns: | Legend :
|
---|
add_line
(artist, *args, **kwargs)[source]¶Add a line to the current plot
Parameters: | x : array-like
y : array-like
projection :
ax : newax :
**kwargs :
|
---|---|
Returns: | Line2D :
|
add_scatter
(artist, *args, **kwargs)[source]¶Add a set or points to the current plot
Parameters: | x : array-like
y : array-like
projection :
ax : newax :
**kwargs. :
|
---|---|
Returns: | Collection :
|
add_spectrogram
(artist, *args, **kwargs)[source]¶Add a Spectrogram
trace to
this plot
Parameters: | spectrogram :
projection :
ax : newax :
**kwargs :
|
---|---|
Returns: | Line2D :
|
add_spectrum
(artist, *args, **kwargs)[source]¶Add a FrequencySeries
trace to this plot
Parameters: | spectrum :
projection :
ax : newax :
**kwargs :
|
---|---|
Returns: | Line2D :
|
add_subplot
(*args, **kwargs)[source]¶Add a subplot. Examples:
fig.add_subplot(111)
# equivalent but more general
fig.add_subplot(1,1,1)
# add subplot with red background
fig.add_subplot(212, axisbg='r')
# add a polar subplot
fig.add_subplot(111, projection='polar')
# add Subplot instance sub
fig.add_subplot(sub)
kwargs are legal Axes
kwargs plus
projection, which chooses a projection type for the axes.
(For backward compatibility, polar=True may also be
provided, which is equivalent to projection=’polar’). Valid
values for projection are: [u’aitoff’, u’hammer’, u’lambert’, u’mollweide’, u’polar’, u’rectilinear’]. Some of
these projections
support additional kwargs, which may be provided to
add_axes()
.
The Axes
instance will be returned.
If the figure already has a subplot with key (args, kwargs) then it will simply make that subplot current and return it.
See also
subplot()
for an
explanation of the args.
The following kwargs are supported:
adjustable: [ ‘box’ | ‘datalim’ | ‘box-forced’] agg_filter: unknown alpha: float (0.0 transparent through 1.0 opaque) anchor: unknown animated: [True | False] aspect: unknown autoscale_on: unknown autoscalex_on: unknown autoscaley_on: unknown axes: anAxes
instance axes_locator: unknown axis_bgcolor: any matplotlib color - seecolors()
axisbelow: [ True | False ] clip_box: amatplotlib.transforms.Bbox
instance clip_on: [True | False] clip_path: [ (Path
,Transform
) |Patch
| None ] color_cycle: unknown contains: a callable function figure: unknown frame_on: [ True | False ] gid: an id string label: string or anything printable with ‘%s’ conversion. navigate: [ True | False ] navigate_mode: unknown path_effects: unknown picker: [None|float|boolean|callable] position: unknown rasterization_zorder: unknown rasterized: [True | False | None] sketch_params: unknown snap: unknown title: unknown transform:Transform
instance url: a url string visible: [True | False] xbound: unknown xlabel: unknown xlim: length 2 sequence of floats xmargin: unknown xscale: [u’linear’ | u’log’ | u’logit’ | u’symlog’] xticklabels: sequence of strings xticks: sequence of floats ybound: unknown ylabel: unknown ylim: length 2 sequence of floats ymargin: unknown yscale: [u’linear’ | u’log’ | u’logit’ | u’symlog’] yticklabels: sequence of strings yticks: sequence of floats zorder: any number
add_timeseries
(artist, *args, **kwargs)[source]¶Add a TimeSeries
trace to this plot
Parameters: | timeseries :
projection :
ax : newax :
**kwargs :
|
---|---|
Returns: | Line2D :
|
get_axes
(projection=None)[source]¶Find all Axes
, optionally matching the given projection
Parameters: | projection :
|
---|
get_title
(figure, *args, **kwargs)[source]¶Get an axes title.
Get one of the three available axes titles. The available titles are positioned above the axes in the center, flush with the left edge, and flush with the right edge.
Parameters: | loc : {‘center’, ‘left’, ‘right’}, str, optional
|
---|---|
Returns: | title: str :
|
get_xscale
(figure, *args, **kwargs)[source]¶Return the xaxis scale string: linear, log, logit, symlog
get_yscale
(figure, *args, **kwargs)[source]¶Return the yaxis scale string: linear, log, logit, symlog
html_map
(figure, *args, **kwargs)[source]¶Create an HTML map for some data contained in these Axes
Parameters: | data :
imagefile :
mapname :
shape :
standalone :
title :
jquery :
|
---|---|
Returns: | HTML :
|
save
(*args, **kwargs)[source]¶Save the figure to disk.
All args
and kwargs
are passed directly to the savefig
method of the underlying matplotlib.figure.Figure
self.fig.savefig(*args, **kwargs)
set_auto_refresh
(b)[source]¶Set this `Plot`s auto-refresh setting
With auto_refresh set to True
, all modifications of the underlying
Axes
will trigger the plot to be re-drawn
Parameters: | b : True or False |
---|
set_title
(artist, *args, **kwargs)[source]¶Set a title for the axes.
Set one of the three available axes titles. The available titles are positioned above the axes in the center, flush with the left edge, and flush with the right edge.
Parameters: | label : str
fontdict : dict
loc : {‘center’, ‘left’, ‘right’}, str, optional
|
---|---|
Returns: | text :
|
Other Parameters: | |
kwargs : text properties
|
set_xlabel
(figure, *args, **kwargs)[source]¶Set the label for the xaxis.
Parameters: | xlabel : string
labelpad : scalar, optional, default: None
|
---|---|
Other Parameters: | |
kwargs : |
See also
text
set_xlim
(artist, *args, **kwargs)[source]¶Call signature:
set_xlim(self, *args, **kwargs):
Set the data limits for the xaxis
Examples:
set_xlim((left, right))
set_xlim(left, right)
set_xlim(left=1) # right unchanged
set_xlim(right=1) # left unchanged
Keyword arguments:
- left: scalar
- The left xlim; xmin, the previous name, may still be used
- right: scalar
- The right xlim; xmax, the previous name, may still be used
- emit: [ True | False ]
- Notify observers of limit change
- auto: [ True | False | None ]
- Turn x autoscaling on (True), off (False; default), or leave unchanged (None)
Note, the left (formerly xmin) value may be greater than the right (formerly xmax). For example, suppose x is years before present. Then one might use:
set_ylim(5000, 0)
so 5000 years ago is on the left of the plot and the present is on the right.
Returns the current xlimits as a length 2 tuple
ACCEPTS: length 2 sequence of floats
set_xscale
(artist, *args, **kwargs)[source]¶Call signature:
set_xscale(value)
Set the scaling of the x-axis: u’linear’ | u’log’ | u’logit’ | u’symlog’
ACCEPTS: [u’linear’ | u’log’ | u’logit’ | u’symlog’]
‘linear’
‘log’
- basex/basey:
- The base of the logarithm
- nonposx/nonposy: [‘mask’ | ‘clip’ ]
- non-positive values in x or y can be masked as invalid, or clipped to a very small positive number
- subsx/subsy:
Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale:
[2, 3, 4, 5, 6, 7, 8, 9]
will place 8 logarithmically spaced minor ticks between each major tick.
‘logit’
- nonpos: [‘mask’ | ‘clip’ ]
- values beyond ]0, 1[ can be masked as invalid, or clipped to a number very close to 0 or 1
‘symlog’
- basex/basey:
- The base of the logarithm
- linthreshx/linthreshy:
- The range (-x, x) within which the plot is linear (to avoid having the plot go to infinity around zero).
- subsx/subsy:
Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale:
[2, 3, 4, 5, 6, 7, 8, 9]
will place 8 logarithmically spaced minor ticks between each major tick.
- linscalex/linscaley:
- This allows the linear range (-linthresh to linthresh) to be stretched relative to the logarithmic range. Its value is the number of decades to use for each half of the linear range. For example, when linscale == 1.0 (the default), the space used for the positive and negative halves of the linear range will be equal to one decade in the logarithmic range.
set_ylabel
(artist, *args, **kwargs)[source]¶Set the label for the yaxis
Parameters: | ylabel : string
labelpad : scalar, optional, default: None
|
---|---|
Other Parameters: | |
kwargs : |
See also
text
set_ylim
(artist, *args, **kwargs)[source]¶Call signature:
set_ylim(self, *args, **kwargs):
Set the data limits for the yaxis
Examples:
set_ylim((bottom, top))
set_ylim(bottom, top)
set_ylim(bottom=1) # top unchanged
set_ylim(top=1) # bottom unchanged
Keyword arguments:
- bottom: scalar
- The bottom ylim; the previous name, ymin, may still be used
- top: scalar
- The top ylim; the previous name, ymax, may still be used
- emit: [ True | False ]
- Notify observers of limit change
- auto: [ True | False | None ]
- Turn y autoscaling on (True), off (False; default), or leave unchanged (None)
Note, the bottom (formerly ymin) value may be greater than the top (formerly ymax). For example, suppose y is depth in the ocean. Then one might use:
set_ylim(5000, 0)
so 5000 m depth is at the bottom of the plot and the surface, 0 m, is at the top.
Returns the current ylimits as a length 2 tuple
ACCEPTS: length 2 sequence of floats
set_yscale
(artist, *args, **kwargs)[source]¶Call signature:
set_yscale(value)
Set the scaling of the y-axis: u’linear’ | u’log’ | u’logit’ | u’symlog’
ACCEPTS: [u’linear’ | u’log’ | u’logit’ | u’symlog’]
‘linear’
‘log’
- basex/basey:
- The base of the logarithm
- nonposx/nonposy: [‘mask’ | ‘clip’ ]
- non-positive values in x or y can be masked as invalid, or clipped to a very small positive number
- subsx/subsy:
Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale:
[2, 3, 4, 5, 6, 7, 8, 9]
will place 8 logarithmically spaced minor ticks between each major tick.
‘logit’
- nonpos: [‘mask’ | ‘clip’ ]
- values beyond ]0, 1[ can be masked as invalid, or clipped to a number very close to 0 or 1
‘symlog’
- basex/basey:
- The base of the logarithm
- linthreshx/linthreshy:
- The range (-x, x) within which the plot is linear (to avoid having the plot go to infinity around zero).
- subsx/subsy:
Where to place the subticks between each major tick. Should be a sequence of integers. For example, in a log10 scale:
[2, 3, 4, 5, 6, 7, 8, 9]
will place 8 logarithmically spaced minor ticks between each major tick.
- linscalex/linscaley:
- This allows the linear range (-linthresh to linthresh) to be stretched relative to the logarithmic range. Its value is the number of decades to use for each half of the linear range. For example, when linscale == 1.0 (the default), the space used for the positive and negative halves of the linear range will be equal to one decade in the logarithmic range.
show
(block=None, warn=True)[source]¶Display the current figure (if possible)
Parameters: |
|
---|
Notes
If blocking is employed, this method calls the
pyplot.show
function, otherwise
the show()
method of this
Figure
is used.
gwpy.plotter.
TimeSeriesPlot
(*series, **kwargs)[source]¶Bases: gwpy.plotter.core.Plot
Figure
for displaying a TimeSeries
.
Parameters: | *series :
**kwargs :
|
---|
Attributes Summary
epoch |
Find the GPS epoch of this plot |
Methods Summary
add_state_segments (segments[, ax, height, ...]) |
Add a SegmentList to this TimeSeriesPlot indicating state information about the main Axes data. |
add_timeseries (timeseries, **kwargs) |
|
get_epoch () |
|
set_epoch (artist, *args, **kwargs) |
Set the GPS epoch of this plot |
Attributes Documentation
epoch
¶Find the GPS epoch of this plot
Methods Documentation
add_state_segments
(segments, ax=None, height=0.2, pad=0.1, location='bottom', plotargs={})[source]¶Add a SegmentList
to this TimeSeriesPlot
indicating state
information about the main Axes data.
By default, segments are displayed in a thin horizontal set of Axes sitting immediately below the x-axis of the main
Parameters: | segments :
ax :
plotargs :
|
---|
gwpy.plotter.
FrequencySeriesPlot
(*series, **kwargs)[source]¶Bases: gwpy.plotter.core.Plot
Figure
for displaying a FrequencySeries
gwpy.plotter.
SpectrogramPlot
(*args, **kwargs)[source]¶Bases: gwpy.plotter.timeseries.TimeSeriesPlot
Figure
for displaying a Spectrogram
.
gwpy.plotter.
SegmentPlot
(*flags, **kwargs)[source]¶Bases: gwpy.plotter.timeseries.TimeSeriesPlot
Figure
for displaying a DataQualityFlag
.
Parameters: | *flags :
insetlabels :
**kwargs :
|
---|
Methods Summary
add_bitmask (mask[, ax, width, pad, visible, ...]) |
Display a state-word bitmask on a new set of Axes. |
add_dataqualityflag (flag, **kwargs) |
Add a DataQualityFlag to this plot |
Methods Documentation
gwpy.plotter.
EventTablePlot
(*args, **kwargs)[source]¶Bases: gwpy.plotter.timeseries.TimeSeriesPlot
Figure
for displaying a Table
.
Parameters: | table :
x :
y :
c :
**kwargs :
|
---|---|
Returns: | plot :
|
Notes
The form of the returned EventTablePlot
is decided at run-time,
rather than when the module was imported.
If tables are passed directly to the constructor, for example:
>>> plot = EventTablePlot(table1, 'time', 'snr')
the columns as given are used to determine the appropriate parent class for the output.
If the input x-column (the first string argument) ends with ‘time’
the output is a child of the TimeSeriesPlot
,
allowing easy formatting of GPS times, while if the x-column ends with
‘frequency’, the output comes from the
FrequencySeriesPlot
, otherwise the parent is
the core Plot
.
Methods Summary
add_table (table, x, y[, color, projection, ...]) |
Add a LIGO_LW Table to this Plot |
add_tiles (table, x, y, width, height[, ...]) |
Add a LIGO_LW Table to this Plot |
Methods Documentation
add_table
(table, x, y, color=None, projection='triggers', ax=None, newax=None, **kwargs)[source]¶Add a LIGO_LW Table to this Plot
Parameters: | table :
x :
y :
c :
projection :
ax : newax :
**kwargs. :
|
---|---|
Returns: | scatter :
|
See also
EventTableAxes.plot_table()
ax
and newax
for this method.add_tiles
(table, x, y, width, height, color=None, anchor='center', projection='triggers', ax=None, newax=None, **kwargs)[source]¶Add a LIGO_LW Table to this Plot
Parameters: | table :
x :
y :
width :
height :
color :
anchor :
projection :
ax : newax :
**kwargs. :
|
---|---|
Returns: | scatter :
|
See also
EventTableAxes.plot_table()
ax
and newax
for this method.gwpy.plotter.
BodePlot
(*filters, **kwargs)[source]¶Bases: gwpy.plotter.core.Plot
A Plot
class for visualising transfer functions.
Parameters: | *filters : frequencies :
db :
**kwargs : |
---|---|
Returns: | plot : |
Attributes Summary
maxes |
FrequencySeriesAxes for the Bode magnitude |
paxes |
FrequencySeriesAxes for the Bode phase |
Methods Summary
add_filter (filter_[, frequencies, dB]) |
Add a linear time-invariant filter to this BodePlot |
add_frequencyseries (spectrum[, dB, power]) |
Plot the magnitude and phase of a complex-valued FrequencySeries |
add_spectrum (*args, **kwargs) |
Attributes Documentation
maxes
¶FrequencySeriesAxes
for the Bode magnitude
paxes
¶FrequencySeriesAxes
for the Bode phase
Methods Documentation
add_filter
(filter_, frequencies=None, dB=True, **kwargs)[source]¶Add a linear time-invariant filter to this BodePlot
Parameters: |
frequencies :
db :
**kwargs :
|
---|---|
Returns: |
|
add_frequencyseries
(spectrum, dB=True, power=False, **kwargs)[source]¶Plot the magnitude and phase of a complex-valued FrequencySeries
Parameters: | spectrum :
db :
power :
**kwargs :
|
---|---|
Returns: |
|
Axes
objects¶Each of the below classes represents a set of axes on which data are displayed; for brevity inherited methods and attributes are not documented here, please follow links to the parent classes for documentation of available methods and attributes.
gwpy.plotter.
Axes
(*args, **kwargs)[source]¶Bases: matplotlib.axes._axes.Axes
An extension of the core matplotlib Axes
.
These custom Axes
provide only some simpler attribute accessors.
Notes
A new set of Axes
should be constructed via:
>>> plot.add_subplots(111, projection='xxx')
where plot is a Plot
figure, and 'xxx'
is the name of the Axes
you want to add.
Attributes Summary
logx |
Display the x-axis with a logarithmic scale |
logy |
Display the y-axis with a logarithmic scale |
projection |
|
xlabel |
Label for the x-axis |
xlim |
Limits for the x-axis |
ylabel |
Label for the y-axis |
ylim |
Limits for the y-axis |
Methods Summary
add_label_unit (artist, *args, **kwargs) |
|
html_map (imagefile[, data]) |
Create an HTML map for some data contained in these Axes |
resize (artist, *args, **kwargs) |
Set the axes position with: |
Attributes Documentation
projection
= 'rectilinear'¶Methods Documentation
html_map
(imagefile, data=None, **kwargs)[source]¶Create an HTML map for some data contained in these Axes
Parameters: | data :
imagefile :
mapname :
shape :
standalone :
title :
jquery :
|
---|---|
Returns: | HTML :
|
resize
(artist, *args, **kwargs)[source]¶Set the axes position with:
pos = [left, bottom, width, height]
in relative 0,1 coords, or pos can be a
Bbox
There are two position variables: one which is ultimately
used, but which may be modified by apply_aspect()
, and a
second which is the starting point for apply_aspect()
.
gwpy.plotter.
TimeSeriesAxes
(*args, **kwargs)[source]¶Bases: gwpy.plotter.axes.Axes
Custom Axes
for a TimeSeriesPlot
.
Attributes Summary
epoch |
|
name |
Methods Summary
auto_gps_label () |
|
auto_gps_scale () |
Automagically set the GPS scale for the time-axis of this plot |
draw (artist, renderer, *args, **kwargs) |
Draw everything (plot lines, axes, labels) |
get_epoch () |
|
plot (artist, *args, **kwargs) |
Plot data onto these Axes. |
plot_spectrogram (artist, *args, **kwargs) |
Plot a Spectrogram onto |
plot_timeseries (artist, *args, **kwargs) |
Plot a TimeSeries onto these |
plot_timeseries_mmm (artist, *args, **kwargs) |
Plot a TimeSeries onto these axes, with (min, max) shaded |
set_epoch (epoch) |
|
set_xlim ([left, right, emit, auto]) |
Call signature: |
set_xscale (scale, *args, **kwargs) |
Attributes Documentation
epoch
¶name
= 'timeseries'¶Methods Documentation
auto_gps_scale
()[source]¶Automagically set the GPS scale for the time-axis of this plot based on the current view limits
draw
(artist, renderer, *args, **kwargs)¶Draw everything (plot lines, axes, labels)
plot
(artist, *args, **kwargs)[source]¶Plot data onto these Axes.
Parameters: | args :
kwargs :
|
---|---|
Returns: | Line2D :
|
See also
matplotlib.axes.Axes.plot()
*args` and ``**kwargs
plot_spectrogram
(artist, *args, **kwargs)[source]¶Plot a Spectrogram
onto
these axes
Parameters: | spectrogram :
**kwargs :
|
---|---|
Returns: | Line2D :
|
See also
matplotlib.axes.Axes.plot()
*args` and ``**kwargs
plot_timeseries
(artist, *args, **kwargs)[source]¶Plot a TimeSeries
onto these
axes
Parameters: | timeseries :
**kwargs :
|
---|---|
Returns: | Line2D :
|
See also
matplotlib.axes.Axes.plot()
*args` and ``**kwargs
plot_timeseries_mmm
(artist, *args, **kwargs)[source]¶Plot a TimeSeries
onto these axes, with (min, max) shaded
regions
The mean_
TimeSeries
is plotted normally, while the min_
and max_ `TimeSeries
are plotted lightly below and above,
with a fill between them and the mean_.
Parameters: | mean_ :
min_ :
max_ :
**kwargs :
|
---|---|
Returns: | artists : |
See also
matplotlib.axes.Axes.plot()
*args` and ``**kwargs
set_xlim
(left=None, right=None, emit=True, auto=False, **kw)[source]¶Call signature:
set_xlim(self, *args, **kwargs):
Set the data limits for the xaxis
Examples:
set_xlim((left, right))
set_xlim(left, right)
set_xlim(left=1) # right unchanged
set_xlim(right=1) # left unchanged
Keyword arguments:
- left: scalar
- The left xlim; xmin, the previous name, may still be used
- right: scalar
- The right xlim; xmax, the previous name, may still be used
- emit: [ True | False ]
- Notify observers of limit change
- auto: [ True | False | None ]
- Turn x autoscaling on (True), off (False; default), or leave unchanged (None)
Note, the left (formerly xmin) value may be greater than the right (formerly xmax). For example, suppose x is years before present. Then one might use:
set_ylim(5000, 0)
so 5000 years ago is on the left of the plot and the present is on the right.
Returns the current xlimits as a length 2 tuple
ACCEPTS: length 2 sequence of floats
gwpy.plotter.
FrequencySeriesAxes
(*args, **kwargs)[source]¶Bases: gwpy.plotter.axes.Axes
Custom Axes
for a FrequencySeriesPlot
.
Attributes Summary
name |
Methods Summary
plot (artist, *args, **kwargs) |
Plot data onto these Axes. |
plot_spectrum (artist, *args, **kwargs) |
Plot a FrequencySeries onto these axes |
plot_spectrum_mmm (artist, *args, **kwargs) |
Plot a FrequencySeries onto these axes, with (min, max) shaded |
plot_variance (artist, *args, **kwargs) |
Plot a SpectralVariance onto |
Attributes Documentation
name
= 'frequencyseries'¶Methods Documentation
plot
(artist, *args, **kwargs)[source]¶Plot data onto these Axes.
Parameters: | args :
kwargs :
|
---|---|
Returns: | Line2D :
|
See also
matplotlib.axes.Axes.plot()
*args` and ``**kwargs
plot_spectrum
(artist, *args, **kwargs)[source]¶Plot a FrequencySeries
onto these axes
Parameters: | spectrum :
**kwargs :
|
---|---|
Returns: | Line2D :
|
See also
matplotlib.axes.Axes.plot()
*args` and ``**kwargs
plot_spectrum_mmm
(artist, *args, **kwargs)[source]¶Plot a FrequencySeries
onto these axes, with (min, max) shaded
regions
The mean_
FrequencySeries
is plotted normally, while the min_
and `max_ spectra are plotted lightly below and above,
with a fill between them and the mean_.
Parameters: | mean_ : :class:`~gwpy.frequencyseries.FrequencySeries
min_ : :class:`~gwpy.frequencyseries.FrequencySeries
max_ : :class:`~gwpy.frequencyseries.FrequencySeries
alpha :
**kwargs :
|
---|---|
Returns: | artists : |
See also
matplotlib.axes.Axes.plot()
*args` and ``**kwargs
plot_variance
(artist, *args, **kwargs)[source]¶Plot a SpectralVariance
onto
these axes
Parameters: | spectrum : class:
**kwargs :
|
---|---|
Returns: | MeshGrid :
|
See also
matplotlib.axes.Axes.pcolormesh()
*args` and ``**kwargs
gwpy.plotter.
SegmentAxes
(*args, **kwargs)[source]¶Bases: gwpy.plotter.timeseries.TimeSeriesAxes
Custom Axes
for a SegmentPlot
.
This SegmentAxes
provides custom methods for displaying any of
DataQualityFlag
Segment
or glue.segments.segment
SegmentList
or glue.segments.segmentlist
SegmentListDict
or glue.segments.segmentlistdict
Parameters: | insetlabels :
|
---|
See also
gwpy.plotter.TimeSeriesAxes
Attributes Summary
insetlabels |
Move the y-axis tick labels inside the axes |
name |
Methods Summary
build_segment (segment, y[, height, valign]) |
Build a Rectangle to display |
draw (artist, renderer, *args, **kwargs) |
Draw everything (plot lines, axes, labels) |
get_collections ([ignore]) |
Return the collections matching the given _ignore value |
get_insetlabels () |
Move the y-axis tick labels inside the axes |
get_next_y () |
Find the next y-axis value at which a segment list can be placed |
plot (*args, **kwargs) |
Plot data onto these axes |
plot_dqdict (artist, *args, **kwargs) |
Plot a DataQualityDict onto these axes |
plot_dqflag (artist, *args, **kwargs) |
Plot a DataQualityFlag |
plot_segmentlist (artist, *args, **kwargs) |
Plot a SegmentList onto these axes |
plot_segmentlistdict (artist, *args, **kwargs) |
Plot a SegmentListDict onto |
set_insetlabels ([inset]) |
|
set_xlim (*args, **kwargs) |
Call signature: |
Attributes Documentation
insetlabels
¶Move the y-axis tick labels inside the axes
name
= 'segments'¶Methods Documentation
build_segment
(segment, y, height=0.8, valign='center', **kwargs)[source]¶Build a Rectangle
to display
a single Segment
Parameters: | segment :
y :
height :
valign :
**kwargs :
|
---|---|
Returns: | box :
|
draw
(artist, renderer, *args, **kwargs)¶Draw everything (plot lines, axes, labels)
get_collections
(ignore=None)[source]¶Return the collections matching the given _ignore
value
Parameters: |
|
---|---|
Returns: | collections :
|
get_next_y
()[source]¶Find the next y-axis value at which a segment list can be placed
This method simply counts the number of independent segmentlists or flags that have been plotted onto these axes.
plot
(*args, **kwargs)[source]¶Plot data onto these axes
Parameters: | args : kwargs :
|
---|---|
Returns: | Line2D :
|
See also
matplotlib.axes.Axes.plot()
*args` and ``**kwargs
plot_dqdict
(artist, *args, **kwargs)[source]¶Plot a DataQualityDict
onto these axes
Parameters: | flags :
label :
known :
**kwargs :
|
---|---|
Returns: | collection :
|
plot_dqflag
(artist, *args, **kwargs)[source]¶Plot a DataQualityFlag
onto these axes
Parameters: | flag :
y :
height :
known :
**kwargs :
|
---|---|
Returns: | collection :
|
plot_segmentlist
(artist, *args, **kwargs)[source]¶Plot a SegmentList
onto these axes
Parameters: | segmentlist :
y :
collection :
label :
**kwargs :
|
---|---|
Returns: | collection :
|
plot_segmentlistdict
(artist, *args, **kwargs)[source]¶Plot a SegmentListDict
onto
these axes
Parameters: | segmentlistdict :
y :
**kwargs :
|
---|---|
Returns: | collections :
|
set_xlim
(*args, **kwargs)[source]¶Call signature:
set_xlim(self, *args, **kwargs):
Set the data limits for the xaxis
Examples:
set_xlim((left, right))
set_xlim(left, right)
set_xlim(left=1) # right unchanged
set_xlim(right=1) # left unchanged
Keyword arguments:
- left: scalar
- The left xlim; xmin, the previous name, may still be used
- right: scalar
- The right xlim; xmax, the previous name, may still be used
- emit: [ True | False ]
- Notify observers of limit change
- auto: [ True | False | None ]
- Turn x autoscaling on (True), off (False; default), or leave unchanged (None)
Note, the left (formerly xmin) value may be greater than the right (formerly xmax). For example, suppose x is years before present. Then one might use:
set_ylim(5000, 0)
so 5000 years ago is on the left of the plot and the present is on the right.
Returns the current xlimits as a length 2 tuple
ACCEPTS: length 2 sequence of floats
gwpy.plotter.
EventTableAxes
(fig, *args, **kwargs)[source]¶Bases: gwpy.plotter.timeseries.TimeSeriesAxes
Custom Axes
for an EventTablePlot
.
The EventTableAxes
inherit from
TimeSeriesAxes
as a convenience to
optionally displaying a time-column. That choice has no effect on the
rest of the Axes
functionality.
Attributes Summary
name |
Methods Summary
add_loudest (table, rank, x, y, *columns, ...) |
Display the loudest event according to some rank. |
plot (*args, **kwargs) |
Plot data onto these axes |
plot_table (table, x, y[, color, size_by, ...]) |
Plot a LIGO_LW-format event Table onto these Axes |
plot_tiles (table, x, y, width, height[, ...]) |
Attributes Documentation
name
= 'triggers'¶Methods Documentation
add_loudest
(table, rank, x, y, *columns, **kwargs)[source]¶Display the loudest event according to some rank.
The loudest event is displayed as a gold star at its
position given by the values in columns x
, and y
,
and those values are displayed in a text box.
Parameters: | table :
rank :
x :
y :
color :
**kwargs :
|
---|---|
Returns: | out :
|
plot
(*args, **kwargs)[source]¶Plot data onto these axes
Parameters: | *args :
**kwargs :
|
---|
plot_table
(table, x, y, color=None, size_by=None, size_by_log=None, size_range=None, **kwargs)[source]¶Plot a LIGO_LW-format event Table
onto these Axes
Parameters: | table :
x :
y :
c :
**kwargs :
|
---|---|
Returns: | collection : |