How to use the gwpy.plotter.decorators.auto_refresh function in gwpy

To help you get started, we’ve selected a few gwpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gwpy / gwpy / gwpy / plotter / core.py View on Github external
    @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`
github gwpy / gwpy / gwpy / plotter / frequencyseries.py View on Github external
    @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
github gwpy / gwpy / gwpy / plotter / frequencyseries.py View on Github external
    @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_``
github gwpy / gwpy / gwpy / plotter / segments.py View on Github external
    @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
github gwpy / gwpy / gwpy / plotter / core.py View on Github external
    @auto_refresh
    @axes_method
    def set_xlim(self, *args, **kwargs):  # pylint: disable=missing-docstring
        pass
    set_xlim.__doc__ = Axes.set_xlim.__doc__
github gwpy / gwpy / gwpy / plotter / axes.py View on Github external
    @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')
github gwpy / gwpy / gwpy / plotter / core.py View on Github external
    @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
github gwpy / gwpy / gwpy / plotter / core.py View on Github external
    @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')
github gwpy / gwpy / gwpy / plotter / core.py View on Github external
    @auto_refresh
    @axes_method
    def set_ylim(self, *args, **kwargs):  # pylint: disable=missing-docstring
        pass
    set_ylim.__doc__ = Axes.set_ylim.__doc__
github gwpy / gwpy / gwpy / plotter / timeseries.py View on Github external
    @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)