How to use the plotnine.utils.alias function in plotnine

To help you get started, we’ve selected a few plotnine 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 has2k1 / plotnine / plotnine / scales / scale_color.py View on Github external
class scale_fill_datetime(scale_datetime, scale_fill_cmap):
    """
    Datetime fill scale

    Parameters
    ----------
    {superclass_parameters}
    """


# Default scales
alias('scale_color_discrete', scale_color_hue)
alias('scale_color_continuous', scale_color_cmap)
alias('scale_color_ordinal', scale_color_cmap_d)
alias('scale_fill_discrete', scale_fill_hue)
alias('scale_fill_continuous', scale_fill_cmap)
alias('scale_fill_ordinal', scale_fill_cmap_d)

# American to British spelling
alias('scale_colour_hue', scale_color_hue)
alias('scale_color_gray', scale_color_grey)
alias('scale_colour_grey', scale_color_grey)
alias('scale_colour_gray', scale_color_grey)
alias('scale_fill_gray', scale_fill_grey)
alias('scale_colour_brewer', scale_color_brewer)
alias('scale_colour_desaturate', scale_color_desaturate)
alias('scale_colour_gradient', scale_color_gradient)
alias('scale_colour_gradient2', scale_color_gradient2)
alias('scale_colour_gradientn', scale_color_gradientn)
alias('scale_colour_discrete', scale_color_hue)
alias('scale_colour_continuous', scale_color_gradient)
alias('scale_colour_distiller', scale_color_distiller)
github has2k1 / plotnine / plotnine / scales / scale_manual.py View on Github external
@document
class scale_size_manual(_scale_manual):
    """
    Custom discrete size scale

    Parameters
    ----------
    values : array_like
        Sizes that make up the palette.
    {superclass_parameters}
    """
    _aesthetics = ['size']


# American to British spelling
alias('scale_colour_manual', scale_color_manual)
github has2k1 / plotnine / plotnine / scales / scale_linetype.py View on Github external
def __init__(self, **kwargs):
        warn(
            "Using linetype for an ordinal variable is not advised.",
            PlotnineWarning
        )
        super().__init__(**kwargs)


class scale_linetype_continuous(scale_continuous):
    def __init__(self):
        raise PlotnineError(
            "A continuous variable can not be mapped to linetype")


alias('scale_linetype_discrete', scale_linetype)
github has2k1 / plotnine / plotnine / scales / scale_color.py View on Github external
----------
    {superclass_parameters}
    """


# Default scales
alias('scale_color_discrete', scale_color_hue)
alias('scale_color_continuous', scale_color_cmap)
alias('scale_color_ordinal', scale_color_cmap_d)
alias('scale_fill_discrete', scale_fill_hue)
alias('scale_fill_continuous', scale_fill_cmap)
alias('scale_fill_ordinal', scale_fill_cmap_d)

# American to British spelling
alias('scale_colour_hue', scale_color_hue)
alias('scale_color_gray', scale_color_grey)
alias('scale_colour_grey', scale_color_grey)
alias('scale_colour_gray', scale_color_grey)
alias('scale_fill_gray', scale_fill_grey)
alias('scale_colour_brewer', scale_color_brewer)
alias('scale_colour_desaturate', scale_color_desaturate)
alias('scale_colour_gradient', scale_color_gradient)
alias('scale_colour_gradient2', scale_color_gradient2)
alias('scale_colour_gradientn', scale_color_gradientn)
alias('scale_colour_discrete', scale_color_hue)
alias('scale_colour_continuous', scale_color_gradient)
alias('scale_colour_distiller', scale_color_distiller)
alias('scale_colour_cmap', scale_color_cmap)
alias('scale_colour_cmap_d', scale_color_cmap_d)
alias('scale_colour_datetime', scale_color_datetime)
alias('scale_colour_ordinal', scale_color_cmap_d)
github has2k1 / plotnine / plotnine / scales / scale_size.py View on Github external
Parameters
    ----------
    range : array_like
        Minimum and maximum area of the plotting symbol.
        It must be of size 2.
    {superclass_parameters}
    """
    _aesthetics = ['size']

    def __init__(self, range=(1, 6), **kwargs):
        self.palette = area_pal(range)
        scale_continuous.__init__(self, **kwargs)


alias('scale_size', scale_size_continuous)


@document
class scale_size_radius(scale_continuous):
    """
    Continuous radius size scale

    Parameters
    ----------
    range : array_like
        Minimum and maximum radius of the plotting symbol.
        It must be of size 2.
    {superclass_parameters}
    """
    _aesthetics = ['size']
github has2k1 / plotnine / plotnine / scales / scale_xy.py View on Github external
{superclass_parameters}
    """


@document
class scale_y_datetime(scale_datetime, scale_y_continuous):
    """
    Continuous y position for datetime data points

    Parameters
    ----------
    {superclass_parameters}
    """


alias('scale_x_date', scale_x_datetime)
alias('scale_y_date', scale_y_datetime)


@document
class scale_x_timedelta(scale_x_continuous):
    """
    Continuous x position for timedelta data points

    Parameters
    ----------
    {superclass_parameters}
    """
    _trans = 'pd_timedelta'


@document
github has2k1 / plotnine / plotnine / scales / scale_color.py View on Github external
# American to British spelling
alias('scale_colour_hue', scale_color_hue)
alias('scale_color_gray', scale_color_grey)
alias('scale_colour_grey', scale_color_grey)
alias('scale_colour_gray', scale_color_grey)
alias('scale_fill_gray', scale_fill_grey)
alias('scale_colour_brewer', scale_color_brewer)
alias('scale_colour_desaturate', scale_color_desaturate)
alias('scale_colour_gradient', scale_color_gradient)
alias('scale_colour_gradient2', scale_color_gradient2)
alias('scale_colour_gradientn', scale_color_gradientn)
alias('scale_colour_discrete', scale_color_hue)
alias('scale_colour_continuous', scale_color_gradient)
alias('scale_colour_distiller', scale_color_distiller)
alias('scale_colour_cmap', scale_color_cmap)
alias('scale_colour_cmap_d', scale_color_cmap_d)
alias('scale_colour_datetime', scale_color_datetime)
alias('scale_colour_ordinal', scale_color_cmap_d)
github has2k1 / plotnine / plotnine / scales / scale_xy.py View on Github external
"""


@document
class scale_y_datetime(scale_datetime, scale_y_continuous):
    """
    Continuous y position for datetime data points

    Parameters
    ----------
    {superclass_parameters}
    """


alias('scale_x_date', scale_x_datetime)
alias('scale_y_date', scale_y_datetime)


@document
class scale_x_timedelta(scale_x_continuous):
    """
    Continuous x position for timedelta data points

    Parameters
    ----------
    {superclass_parameters}
    """
    _trans = 'pd_timedelta'


@document
class scale_y_timedelta(scale_y_continuous):
github has2k1 / plotnine / plotnine / scales / scale_xy.py View on Github external
@document
class scale_y_discrete(scale_position_discrete):
    """
    Discrete y position

    Parameters
    ----------
    {superclass_parameters}
    """
    _aesthetics = ['y', 'ymin', 'ymax', 'yend']


# Not part of the user API
alias('scale_x_ordinal', scale_x_discrete)
alias('scale_y_ordinal', scale_y_discrete)


@document
class scale_x_continuous(scale_position_continuous):
    """
    Continuous x position

    Parameters
    ----------
    {superclass_parameters}
    """
    _aesthetics = ['x', 'xmin', 'xmax', 'xend', 'xintercept']


@document
github has2k1 / plotnine / plotnine / scales / scale_color.py View on Github external
# Default scales
alias('scale_color_discrete', scale_color_hue)
alias('scale_color_continuous', scale_color_cmap)
alias('scale_color_ordinal', scale_color_cmap_d)
alias('scale_fill_discrete', scale_fill_hue)
alias('scale_fill_continuous', scale_fill_cmap)
alias('scale_fill_ordinal', scale_fill_cmap_d)

# American to British spelling
alias('scale_colour_hue', scale_color_hue)
alias('scale_color_gray', scale_color_grey)
alias('scale_colour_grey', scale_color_grey)
alias('scale_colour_gray', scale_color_grey)
alias('scale_fill_gray', scale_fill_grey)
alias('scale_colour_brewer', scale_color_brewer)
alias('scale_colour_desaturate', scale_color_desaturate)
alias('scale_colour_gradient', scale_color_gradient)
alias('scale_colour_gradient2', scale_color_gradient2)
alias('scale_colour_gradientn', scale_color_gradientn)
alias('scale_colour_discrete', scale_color_hue)
alias('scale_colour_continuous', scale_color_gradient)
alias('scale_colour_distiller', scale_color_distiller)
alias('scale_colour_cmap', scale_color_cmap)
alias('scale_colour_cmap_d', scale_color_cmap_d)
alias('scale_colour_datetime', scale_color_datetime)
alias('scale_colour_ordinal', scale_color_cmap_d)