SegmentAxes#
- class gwpy.plot.SegmentAxes( )[source]#
Bases:
AxesCustom
Axesto display segments.This
SegmentAxesprovides custom methods for displaying any of- Parameters:
See also
gwpy.plot.Axesfor documentation of other args and kwargs
Attributes Summary
Return the inset labels state.
Methods Summary
draw(renderer)Draw the Artist (and its children) using the given renderer.
get_collections([ignore])Return the collections matching the given
_ignorevalue.Return the inset labels state.
Find the next y-axis value at which a segment list can be placed.
plot(*args, **kwargs)Plot data onto these axes.
plot_dict(flags[, label, known])Plot a
DataQualityDictonto these axes.plot_flag(flag[, y])Plot a
DataQualityFlagonto these axes.plot_segmentlist(segmentlist[, y, height, ...])Plot a
SegmentListonto these axes.plot_segmentlistdict(segmentlistdict[, y, dy])Plot a
SegmentListDictonto these axes.set(*[, adjustable, agg_filter, alpha, ...])Set multiple properties at once.
set_insetlabels([inset])Set the labels to be inset or not.
Attributes Documentation
- name = 'segments'#
Methods Documentation
- draw(renderer)#
Draw the Artist (and its children) using the given renderer.
This has no effect if the artist is not visible (
Artist.get_visiblereturns False).- Parameters:
- renderer
RendererBasesubclass.
- renderer
Notes
This method is overridden in the Artist subclasses.
- get_collections(ignore: bool | None = None) list[Collection][source]#
Return the collections matching the given
_ignorevalue.- Parameters:
- Returns:
- collections
listofCollection If
ignore=None, simply returns all collections, otherwise returns those collections matching theignoreparameter.
- collections
- get_next_y() int[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: DataQualityFlag | DataQualityDict | segmentlist | segmentlistdict,
- **kwargs,
Plot data onto these axes.
- Parameters:
- args
A single instance of
or equivalent types upstream from
igwn_segments.- kwargs
All keyword arguments are passed to
plotwhen drawing each object.
- Returns:
See also
matplotlib.axes.Axes.plotfor a full description of acceptable
*args` and ``**kwargs.
- plot_dict(
- flags: DataQualityDict,
- label: str = 'key',
- known: str | dict | None = 'x',
- **kwargs,
Plot a
DataQualityDictonto these axes.- Parameters:
- flags
DataQualityDict The data-quality dict to display.
- label
str, optional Labelling system to use, or fixed label for all
DataQualityFlags. Special values include'key'Use the key of the
DataQualityDict.'name'Use the
nameof theDataQualityFlag.
If anything else, that fixed label will be used for all lines.
- known
str,dict,None, optional Display
knownsegments with the given hatching, or give a dict of keyword arguments to pass toplot_segmentlist(), orNoneto hide.- kwargs
All other keyword arguments are passed to
SegmentRectangle.
- flags
- Returns:
- artists
listofPatchCollection The list of patch collections that were drawn.
- artists
- plot_flag(
- flag: DataQualityFlag,
- y: float | None = None,
- **kwargs,
Plot a
DataQualityFlagonto these axes.- Parameters:
- Returns:
- artists
listofPatchCollection The list of patch collections that were drawn.
- artists
- plot_segmentlist(
- segmentlist: segmentlist,
- y: float | None = None,
- height: float = 0.8,
- label: str | None = None,
- *,
- collection: bool = True,
- rasterized: bool | None = None,
- **kwargs,
Plot a
SegmentListonto these axes.- Parameters:
- segmentlist
SegmentList List of segments to display.
- y
float, optional Y-axis value for new segments.
- height
float, optional Height (in y-axis units) for segment.
- collection
bool, optional If
True(default), bundle all patches as aPatchCollection, otherwise just return alistofSegmentRectanglepatches.- rasterized
bool, optional If
True, rasterise the patches when drawing. Default isFalse.- label
str, optional custom descriptive name to print as y-axis tick label
- kwargs
All other keyword arguments are passed to
SegmentRectangle.
- segmentlist
- Returns:
- patches
PatchCollectionorlist[SegmentRectangle] The drawn patches, bundled in a
PatchCollectionifcollection=True.
- patches
- plot_segmentlistdict( ) PatchCollection | list[SegmentRectangle][source]#
Plot a
SegmentListDictonto these axes.- Parameters:
- segmentlistdict
SegmentListDict (name,
SegmentList) dict.- y
float, optional Starting y-axis value for new segmentlists.
- dy
float, optional Y-axis separation between each (anchor of each) segmentlist.
- kwargs
All other keyword arguments are passed to
Rectangle.
- segmentlistdict
- Returns:
- collections
listofPatchCollection List of
PatchCollectionsets for each segmentlist.
- collections
- set(
- *,
- adjustable=<UNSET>,
- agg_filter=<UNSET>,
- alpha=<UNSET>,
- anchor=<UNSET>,
- animated=<UNSET>,
- aspect=<UNSET>,
- autoscale_on=<UNSET>,
- autoscalex_on=<UNSET>,
- autoscaley_on=<UNSET>,
- axes_locator=<UNSET>,
- axisbelow=<UNSET>,
- box_aspect=<UNSET>,
- clip_box=<UNSET>,
- clip_on=<UNSET>,
- clip_path=<UNSET>,
- epoch=<UNSET>,
- facecolor=<UNSET>,
- forward_navigation_events=<UNSET>,
- frame_on=<UNSET>,
- gid=<UNSET>,
- in_layout=<UNSET>,
- insetlabels=<UNSET>,
- label=<UNSET>,
- mouseover=<UNSET>,
- navigate=<UNSET>,
- path_effects=<UNSET>,
- picker=<UNSET>,
- position=<UNSET>,
- prop_cycle=<UNSET>,
- rasterization_zorder=<UNSET>,
- rasterized=<UNSET>,
- sketch_params=<UNSET>,
- snap=<UNSET>,
- subplotspec=<UNSET>,
- title=<UNSET>,
- transform=<UNSET>,
- url=<UNSET>,
- visible=<UNSET>,
- xbound=<UNSET>,
- xlabel=<UNSET>,
- xlim=<UNSET>,
- xmargin=<UNSET>,
- xscale=<UNSET>,
- xticklabels=<UNSET>,
- xticks=<UNSET>,
- ybound=<UNSET>,
- ylabel=<UNSET>,
- ylim=<UNSET>,
- ymargin=<UNSET>,
- yscale=<UNSET>,
- yticklabels=<UNSET>,
- yticks=<UNSET>,
- zorder=<UNSET>,
Set multiple properties at once.
Supported properties are
- Properties:
adjustable: {‘box’, ‘datalim’} agg_filter: a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image alpha: float or None anchor: (float, float) or {‘C’, ‘SW’, ‘S’, ‘SE’, ‘E’, ‘NE’, …} animated: bool aspect: {‘auto’, ‘equal’} or float autoscale_on: bool autoscalex_on: unknown autoscaley_on: unknown axes_locator: Callable[[Axes, Renderer], Bbox] axisbelow: bool or ‘line’ box_aspect: float or None clip_box:
BboxBaseor None clip_on: bool clip_path: Patch or (Path, Transform) or None epoch:float,strfacecolor or fc: color figure:FigureorSubFigureforward_navigation_events: bool or “auto” frame_on: bool gid: str in_layout: bool insetlabels:bool,Nonelabel: object mouseover: bool navigate: bool navigate_mode: unknown path_effects: list ofAbstractPathEffectpicker: None or bool or float or callable position: [left, bottom, width, height] orBboxprop_cycle:Cyclerrasterization_zorder: float or None rasterized: bool sketch_params: (scale: float, length: float, randomness: float) snap: bool or None subplotspec: unknown title: str transform:Transformurl: str visible: bool xbound: (lower: float, upper: float) xlabel: str xlim: (left: float, right: float) xmargin: float greater than -0.5 xscale: unknown xticklabels: unknown xticks: unknown ybound: (lower: float, upper: float) ylabel: str ylim: (bottom: float, top: float) ymargin: float greater than -0.5 yscale: unknown yticklabels: unknown yticks: unknown zorder: float