Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@auto_refresh
def add_image(self, image, projection=None, ax=None, newax=False,
**kwargs):
"""Add a 2-D image to this plot
Parameters
----------
image : `numpy.ndarray`
2-D array of data for the image
**kwargs
other keyword arguments are passed to the
:meth:`matplotlib.axes.Axes.imshow` function
Returns
-------
image : `~matplotlib.image.AxesImage`
@auto_refresh
def plot(self, *args, **kwargs):
"""Plot data onto these Axes.
Parameters
----------
args
a single `~gwpy.frequencyseries.FrequencySeries`
(or sub-class) or standard (x, y) data arrays
kwargs
keyword arguments applicable to :meth:`~matplotib.axes.Axes.plot`
Returns
-------
Line2D
the `~matplotlib.lines.Line2D` for this line layer
@auto_refresh
def plot_frequencyseries_mmm(self, mean_, min_=None, max_=None, alpha=0.1,
**kwargs):
"""Plot a `FrequencySeries` onto these axes, with shaded regions
The ``mean_`` `FrequencySeries` is plotted normally, while the
``min_`` and ``max_`` series are plotted lightly below and above,
with a fill between them and ``mean_``.
Parameters
----------
mean_ : `~gwpy.frequencyseries.FrequencySeries`
data to plot normally
min_ : `~gwpy.frequencyseries.FrequencySeries`
first data set to shade to ``mean_``
@auto_refresh
def plot_segmentlist(self, segmentlist, y=None, collection=True,
label=None, rasterized=None, **kwargs):
"""Plot a `~gwpy.segments.SegmentList` onto these axes
Parameters
----------
segmentlist : `~gwpy.segments.SegmentList`
list of segments to display
y : `float`, optional
y-axis value for new segments
collection : `bool`, default: `True`
add all patches as a
`~matplotlib.collections.PatchCollection`, doesn't seem
to work for hatched rectangles
@auto_refresh
@axes_method
def set_xlim(self, *args, **kwargs): # pylint: disable=missing-docstring
pass
set_xlim.__doc__ = Axes.set_xlim.__doc__
@auto_refresh
def logx(self, log):
if log and not self.logx:
self.set_xscale('log')
elif self.logx and not log:
self.set_xscale('linear')
@auto_refresh
def add_colorbar(self, mappable=None, ax=None, location='right',
width=0.15, pad=0.08, log=None, label="", clim=None,
cmap=None, clip=None, visible=True, axes_class=Axes,
**kwargs):
"""Add a colorbar to the current `Plot`
A colorbar must be associated with an `Axes` on this `Plot`,
and an existing mappable element (e.g. an image) (if `visible=True`).
Parameters
----------
mappable : matplotlib data collection
collection against which to map the colouring
ax : `~matplotlib.axes.Axes`
axes from which to steal space for the colorbar
@auto_refresh
def logx(self, log):
if not self.logx and bool(log):
self.set_xscale('log')
elif self.logx and not bool(log):
self.set_xscale('linear')
@auto_refresh
@axes_method
def set_ylim(self, *args, **kwargs): # pylint: disable=missing-docstring
pass
set_ylim.__doc__ = Axes.set_ylim.__doc__
@auto_refresh
def plot_timeseries_mmm(self, mean_, min_=None, max_=None, **kwargs):
warnings.warn('plot_timeseries_mmm has been deprecated, please '
'use instead plot_mmm()', DeprecationWarning)
return self.plot_mmm(mean_, min_=min_, max_=max_, **kwargs)