How to use the proplot.internals.docstring.add_snippets function in proplot

To help you get started, we’ve selected a few proplot 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 lukelbd / proplot / proplot / colors.py View on Github external
    @docstring.add_snippets
    def set_gamma(self, gamma=None, gamma1=None, gamma2=None):
        """
        Modify the gamma value(s) and refresh the lookup table.

        Parameters
        ----------
        %(cmap.gamma)s
        """
        gamma1 = _not_none(gamma1, gamma)
        gamma2 = _not_none(gamma2, gamma)
        if gamma1 is not None:
            self._gamma1 = gamma1
        if gamma2 is not None:
            self._gamma2 = gamma2
        self._init()
github lukelbd / proplot / proplot / crs.py View on Github external
    @docstring.add_snippets
    def __init__(self, central_longitude=0.0, globe=None):
        """
        %(proj.init)s
        """
        super().__init__(
            central_latitude=-90,
            central_longitude=central_longitude, globe=globe
        )
github lukelbd / proplot / proplot / axes / base.py View on Github external
    @docstring.add_snippets
    def inset_axes(
        self, bounds, transform=None, zorder=4,
        zoom=None, zoom_kw=None,
        proj=None, proj_kw=None, projection=None, projection_kw=None, basemap=None,
        **kwargs
    ):
        """
        %(axes.inset)s
        """
        # Carbon copy with my custom axes
        if not transform:
            transform = self.transAxes
        else:
            transform = _get_transform(self, transform)
        label = kwargs.pop('label', 'inset_axes')
        proj = _not_none(proj=proj, projection=projection)
github lukelbd / proplot / proplot / axes / cartesian.py View on Github external
    @docstring.add_snippets
    def format(
        self, *,
        aspect=None,
        xloc=None, yloc=None,
        xspineloc=None, yspineloc=None,
        xtickloc=None, ytickloc=None, fixticks=False,
        xlabelloc=None, ylabelloc=None,
        xticklabelloc=None, yticklabelloc=None,
        xtickdir=None, ytickdir=None,
        xgrid=None, ygrid=None,
        xgridminor=None, ygridminor=None,
        xtickminor=None, ytickminor=None,
        xticklabeldir=None, yticklabeldir=None,
        xtickrange=None, ytickrange=None,
        xwraprange=None, ywraprange=None,
        xreverse=None, yreverse=None,
github lukelbd / proplot / proplot / utils.py View on Github external
@docstring.add_snippets
def to_rgba(color, space='rgb', cycle=None):
    """
    Translate the color in *any* format and from *any* colorspace to an RGB
    tuple. This is a generalization of `matplotlib.colors.to_rgba` and the
    inverse of `to_xyza`.

    Parameters
    ----------
    %(param.to_rgb)s

    Returns
    -------
    %(return.rgba)s

    See also
    --------
github lukelbd / proplot / proplot / utils.py View on Github external
@docstring.add_snippets
def scale_saturation(color, scale=1, space='hcl'):
    """
    Scale the saturation channel of a color.

    Parameters
    ----------
    %(param.rgba)s
    scale : float, optoinal
        The HCL saturation channel is multiplied by this value.
    %(param.space)s

    Returns
    -------
    %(return.rgba)s

    See also
github lukelbd / proplot / proplot / utils.py View on Github external
@docstring.add_snippets
def to_xyza(color, space='hcl'):
    """
    Translate color in *any* format to a tuple of channel values in *any*
    colorspace. This is the inverse of `to_rgba`.

    Parameters
    ----------
    %(param.rgba)s
    space : {'hcl', 'hpl', 'hsl', 'hsv', 'rgb'}, optional
        The colorspace for the output channel values.

    Returns
    -------
    color : 3-tuple
        Tuple of channel values for the colorspace `space`.
github lukelbd / proplot / proplot / axes / polar.py View on Github external
    @docstring.add_snippets
    def format(
        self, *args,
        r0=None, theta0=None, thetadir=None,
        thetamin=None, thetamax=None, thetalim=None,
        rmin=None, rmax=None, rlim=None,
        rlabelpos=None, rscale=None, rborder=None,
        thetalocator=None, rlocator=None, thetalines=None, rlines=None,
        thetaformatter=None, rformatter=None,
        thetalabels=None, rlabels=None,
        thetalocator_kw=None, rlocator_kw=None,
        thetaformatter_kw=None, rformatter_kw=None,
        patch_kw=None,
        **kwargs
    ):
        """
        Modify radial gridline locations, gridline labels, limits, and more.
github lukelbd / proplot / proplot / utils.py View on Github external
@docstring.add_snippets
def set_luminance(color, luminance, space='hcl'):
    """
    Return a color with a different luminance and the same hue and saturation
    as the input color.

    Parameters
    ----------
    %(param.rgba)s
    luminance : float, optional
        The new luminance. Should lie between ``0`` and ``100``.
    %(param.space)s

    Returns
    -------
    %(return.rgba)s