repo stringlengths 2 99 | file stringlengths 13 225 | code stringlengths 0 18.3M | file_length int64 0 18.3M | avg_line_length float64 0 1.36M | max_line_length int64 0 4.26M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
plotnine | plotnine-main/plotnine/geoms/geom_raster.py | from __future__ import annotations
import typing
from warnings import warn
import numpy as np
from ..coords import coord_cartesian
from ..doctools import document
from ..exceptions import PlotnineError, PlotnineWarning
from ..utils import resolution
from .geom import geom
from .geom_polygon import geom_polygon
if t... | 6,130 | 30.932292 | 75 | py |
plotnine | plotnine-main/plotnine/geoms/geom_qq_line.py | from ..doctools import document
from .geom_path import geom_path
@document
class geom_qq_line(geom_path):
"""
Quantile-Quantile Line plot
{usage}
Parameters
----------
{common_parameters}
"""
DEFAULT_PARAMS = {
"stat": "qq_line",
"position": "identity",
"na_r... | 337 | 14.363636 | 32 | py |
plotnine | plotnine-main/plotnine/geoms/geom_tile.py | from __future__ import annotations
import typing
from ..doctools import document
from ..utils import resolution
from .geom_rect import geom_rect
if typing.TYPE_CHECKING:
import pandas as pd
@document
class geom_tile(geom_rect):
"""
Rectangles specified using a center points
{usage}
Parameters... | 1,234 | 19.932203 | 61 | py |
plotnine | plotnine-main/plotnine/geoms/geom_count.py | from ..doctools import document
from .geom_point import geom_point
@document
class geom_count(geom_point):
"""
Plot overlapping points
This is a variant :class:`geom_point` that counts the number
of observations at each location, then maps the count to point
area. It useful when you have discrete... | 498 | 21.681818 | 76 | py |
plotnine | plotnine-main/plotnine/geoms/geom_density.py | from ..doctools import document
from .geom_area import geom_area
@document
class geom_density(geom_area):
"""
Smooth density estimate
{usage}
Parameters
----------
{common_parameters}
See Also
--------
plotnine.geoms.geom_ribbon
"""
DEFAULT_AES = dict(
geom_area... | 502 | 16.964286 | 79 | py |
plotnine | plotnine-main/plotnine/geoms/geom_ribbon.py | from __future__ import annotations
import typing
from contextlib import suppress
from ..coords import coord_flip
from ..doctools import document
from ..exceptions import PlotnineError
from ..utils import SIZE_FACTOR, to_rgba
from .geom import geom
from .geom_path import geom_path
from .geom_polygon import geom_polygo... | 5,640 | 28.380208 | 75 | py |
plotnine | plotnine-main/plotnine/geoms/geom_area.py | from __future__ import annotations
import typing
from ..doctools import document
from .geom_ribbon import geom_ribbon
if typing.TYPE_CHECKING:
import pandas as pd
@document
class geom_area(geom_ribbon):
"""
Area plot
An area plot is a special case of geom_ribbon,
where the minimum of the range... | 822 | 18.595238 | 61 | py |
plotnine | plotnine-main/plotnine/geoms/geom_path.py | from __future__ import annotations
import typing
from collections import Counter
from contextlib import suppress
from warnings import warn
import numpy as np
from ..doctools import document
from ..exceptions import PlotnineWarning
from ..utils import SIZE_FACTOR, make_line_segments, match, to_rgba
from .geom import ... | 16,405 | 29.213628 | 79 | py |
plotnine | plotnine-main/plotnine/geoms/geom_polygon.py | from __future__ import annotations
import typing
import numpy as np
from ..doctools import document
from ..utils import SIZE_FACTOR, to_rgba
from .geom import geom
if typing.TYPE_CHECKING:
from typing import Any
import pandas as pd
from plotnine.iapi import panel_view
from plotnine.typing import A... | 3,930 | 24.038217 | 71 | py |
plotnine | plotnine-main/plotnine/geoms/geom_violin.py | from __future__ import annotations
import typing
import numpy as np
import pandas as pd
from ..doctools import document
from ..utils import groupby_apply, interleave, resolution
from .geom import geom
from .geom_path import geom_path
from .geom_polygon import geom_polygon
if typing.TYPE_CHECKING:
from typing im... | 6,408 | 30.571429 | 78 | py |
plotnine | plotnine-main/plotnine/geoms/annotation_logticks.py | from __future__ import annotations
import typing
import warnings
import numpy as np
import pandas as pd
from ..coords import coord_flip
from ..exceptions import PlotnineWarning
from ..scales.scale import scale_continuous as ScaleContinuous
from ..utils import log
from .annotate import annotate
from .geom_path import... | 9,349 | 29.756579 | 77 | py |
plotnine | plotnine-main/plotnine/geoms/geom_bin_2d.py | from ..doctools import document
from .geom_rect import geom_rect
@document
class geom_bin_2d(geom_rect):
"""
Heatmap of 2d bin counts
Divides the plane into rectangles, counts the number of
cases in each rectangle, and then (by default) maps the number
of cases to the rectangle's fill. This is a ... | 574 | 21.115385 | 79 | py |
plotnine | plotnine-main/plotnine/geoms/geom_crossbar.py | from __future__ import annotations
import typing
from warnings import warn
import numpy as np
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineWarning
from ..utils import SIZE_FACTOR, copy_missing_columns, resolution, to_rgba
from .geom import geom
from .geom_polygon import geom_p... | 6,151 | 27.613953 | 74 | py |
plotnine | plotnine-main/plotnine/geoms/geom_density_2d.py | from ..doctools import document
from .geom_path import geom_path
@document
class geom_density_2d(geom_path):
"""
2D density estimate
This is a 2d version of :class:`~plotnine.geoms.geom_density`.
{usage}
Parameters
----------
{common_parameters}
"""
DEFAULT_PARAMS = {
"... | 403 | 15.833333 | 66 | py |
plotnine | plotnine-main/plotnine/geoms/geom_rug.py | from __future__ import annotations
import typing
import numpy as np
from ..coords import coord_flip
from ..doctools import document
from ..utils import SIZE_FACTOR, make_line_segments, to_rgba
from .geom import geom
from .geom_path import geom_path
if typing.TYPE_CHECKING:
from typing import Any
import pan... | 3,350 | 26.243902 | 67 | py |
plotnine | plotnine-main/plotnine/geoms/geom_vline.py | from __future__ import annotations
import typing
from warnings import warn
import numpy as np
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineWarning
from ..mapping import aes
from ..utils import SIZE_FACTOR, order_as_data_mapping, to_rgba
from .geom import geom
from .geom_segmen... | 3,229 | 22.75 | 77 | py |
plotnine | plotnine-main/plotnine/geoms/__init__.py | """
Plotting objects
"""
from .annotate import annotate
from .annotation_logticks import annotation_logticks
from .annotation_stripes import annotation_stripes
from .geom_abline import geom_abline
from .geom_area import geom_area
from .geom_bar import geom_bar
from .geom_bin_2d import geom_bin2d, geom_bin_2d
from .geo... | 2,697 | 25.45098 | 52 | py |
plotnine | plotnine-main/plotnine/geoms/geom_qq.py | from ..doctools import document
from .geom_point import geom_point
@document
class geom_qq(geom_point):
"""
Quantile-Quantile plot
{usage}
Parameters
----------
{common_parameters}
"""
DEFAULT_PARAMS = {"stat": "qq", "position": "identity", "na_rm": False}
| 294 | 15.388889 | 75 | py |
plotnine | plotnine-main/plotnine/geoms/geom_label.py | from __future__ import annotations
import typing
from ..doctools import document
from ..utils import to_rgba
from .geom_text import geom_text
if typing.TYPE_CHECKING:
from typing import Any
import pandas as pd
from plotnine.typing import DrawingArea, Layer
_aes = geom_text.DEFAULT_AES.copy()
_aes["fi... | 2,862 | 23.058824 | 64 | py |
plotnine | plotnine-main/plotnine/geoms/geom_jitter.py | from __future__ import annotations
import typing
from ..doctools import document
from ..exceptions import PlotnineError
from ..positions import position_jitter
from .geom_point import geom_point
if typing.TYPE_CHECKING:
from typing import Any
from plotnine.typing import Aes, DataLike
@document
class geom_... | 2,283 | 25.870588 | 69 | py |
plotnine | plotnine-main/plotnine/geoms/geom_sina.py | from ..doctools import document
from .geom_point import geom_point
@document
class geom_sina(geom_point):
"""
Draw a sina plot
A sina plot is a data visualization chart suitable for plotting
any single variable in a multiclass dataset. It is an enhanced
jitter strip chart, where the width of the ... | 916 | 25.2 | 74 | py |
plotnine | plotnine-main/plotnine/geoms/geom_pointdensity.py | from ..doctools import document
from .geom_point import geom_point
@document
class geom_pointdensity(geom_point):
"""
Scatterplot with density estimation at each point
{usage}
Parameters
----------
{common_parameters}
"""
DEFAULT_PARAMS = {
"stat": "pointdensity",
"p... | 372 | 15.954545 | 53 | py |
plotnine | plotnine-main/plotnine/geoms/geom_boxplot.py | from __future__ import annotations
import typing
from warnings import warn
import numpy as np
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineWarning
from ..positions import position_dodge2
from ..positions.position import position
from ..utils import (
SIZE_FACTOR,
copy_... | 9,457 | 29.025397 | 78 | py |
plotnine | plotnine-main/plotnine/geoms/geom_text.py | from __future__ import annotations
import typing
from contextlib import suppress
from warnings import warn
import numpy as np
from ..doctools import document
from ..exceptions import PlotnineError, PlotnineWarning
from ..positions import position_nudge
from ..utils import order_as_data_mapping, to_rgba
from .geom im... | 9,387 | 28.898089 | 79 | py |
plotnine | plotnine-main/plotnine/geoms/annotation_stripes.py | from __future__ import annotations
import typing
from itertools import cycle, islice
import numpy as np
import pandas as pd
from ..coords import coord_flip
from ..scales.scale import scale_discrete
from .annotate import annotate
from .geom import geom
from .geom_polygon import geom_polygon
from .geom_rect import geo... | 6,120 | 30.389744 | 77 | py |
plotnine | plotnine-main/plotnine/geoms/geom_spoke.py | from __future__ import annotations
import typing
import numpy as np
from ..doctools import document
from .geom_segment import geom_segment
if typing.TYPE_CHECKING:
import pandas as pd
@document
class geom_spoke(geom_segment):
"""
Line segment parameterised by location, direction and distance
{usa... | 983 | 20.391304 | 66 | py |
plotnine | plotnine-main/plotnine/geoms/geom_rect.py | from __future__ import annotations
import typing
import numpy as np
import pandas as pd
from ..doctools import document
from ..utils import SIZE_FACTOR, to_rgba
from .geom import geom
from .geom_polygon import geom_polygon
if typing.TYPE_CHECKING:
from typing import Any
from plotnine.iapi import panel_view... | 3,679 | 24.37931 | 77 | py |
plotnine | plotnine-main/plotnine/geoms/geom_freqpoly.py | from ..doctools import document
from .geom_path import geom_path
_params = geom_path.DEFAULT_PARAMS.copy()
_params["stat"] = "bin"
@document
class geom_freqpoly(geom_path):
"""
Frequency polygon
{usage}
See :class:`~plotnine.geoms.geom_path` for documentation
of the parameters.
"""
DEF... | 342 | 16.15 | 60 | py |
plotnine | plotnine-main/plotnine/geoms/geom_step.py | from __future__ import annotations
import typing
import numpy as np
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineError
from ..utils import copy_missing_columns
from .geom import geom
from .geom_path import geom_path
if typing.TYPE_CHECKING:
from typing import Any
fro... | 2,337 | 25.873563 | 68 | py |
plotnine | plotnine-main/plotnine/geoms/geom_bar.py | from __future__ import annotations
import typing
from ..doctools import document
from ..utils import resolution
from .geom_rect import geom_rect
if typing.TYPE_CHECKING:
import pandas as pd
@document
class geom_bar(geom_rect):
"""
Bar plot
{usage}
Parameters
----------
{common_paramet... | 1,373 | 21.9 | 66 | py |
plotnine | plotnine-main/plotnine/guides/guides.py | from __future__ import annotations
import typing
from copy import deepcopy
from warnings import warn
import numpy as np
import pandas as pd
from ..exceptions import PlotnineError, PlotnineWarning
from ..utils import Registry, is_string
from .guide import guide as guide_class
if typing.TYPE_CHECKING:
from typing... | 9,811 | 28.115727 | 77 | py |
plotnine | plotnine-main/plotnine/guides/guide_axis.py | from .guide import guide
class guide_axis(guide):
"""
Axis
"""
# parameter
available_aes = {"x", "y"}
def draw(self):
pass
| 159 | 10.428571 | 30 | py |
plotnine | plotnine-main/plotnine/guides/guide_colorbar.py | from __future__ import annotations
import hashlib
import typing
from warnings import warn
import numpy as np
import pandas as pd
from mizani.bounds import rescale
from ..exceptions import PlotnineWarning
from ..mapping.aes import rename_aesthetics
from ..scales.scale import scale_continuous
from .guide import guide
... | 12,246 | 28.159524 | 78 | py |
plotnine | plotnine-main/plotnine/guides/guide.py | from __future__ import annotations
import typing
from ..exceptions import PlotnineError
from ..utils import Registry
if typing.TYPE_CHECKING:
from typing import Any, Literal, Optional
import pandas as pd
from plotnine.typing import Scale, Theme
class guide(metaclass=Registry):
"""
Base class ... | 7,363 | 31.440529 | 75 | py |
plotnine | plotnine-main/plotnine/guides/__init__.py | from .guide_colorbar import guide_colorbar, guide_colourbar
from .guide_legend import guide_legend
from .guides import guides
__all__ = ("guide_colorbar", "guide_colourbar", "guide_legend", "guides")
| 201 | 32.666667 | 73 | py |
plotnine | plotnine-main/plotnine/guides/guide_legend.py | from __future__ import annotations
import hashlib
import types
import typing
from contextlib import suppress
from itertools import islice
from warnings import warn
import numpy as np
import pandas as pd
from ..exceptions import PlotnineError, PlotnineWarning
from ..geoms import geom_text
from ..mapping.aes import re... | 12,707 | 31.090909 | 79 | py |
plotnine | plotnine-main/plotnine/coords/coord_cartesian.py | from __future__ import annotations
import typing
from types import SimpleNamespace
from ..iapi import panel_view
from ..positions.position import transform_position
from .coord import coord, dist_euclidean
if typing.TYPE_CHECKING:
from typing import Optional
import pandas as pd
from plotnine.iapi impor... | 2,703 | 26.876289 | 79 | py |
plotnine | plotnine-main/plotnine/coords/coord_flip.py | from __future__ import annotations
import typing
from typing import overload
import pandas as pd
from ..iapi import labels_view, panel_ranges, panel_view
from .coord_cartesian import coord_cartesian
if typing.TYPE_CHECKING:
from plotnine.typing import Scale
class coord_flip(coord_cartesian):
"""
Flipp... | 3,200 | 26.834783 | 79 | py |
plotnine | plotnine-main/plotnine/coords/coord_fixed.py | from __future__ import annotations
import typing
from .coord_cartesian import coord_cartesian
if typing.TYPE_CHECKING:
from typing import Optional
from plotnine.iapi import panel_view
from plotnine.typing import TupleFloat2
class coord_fixed(coord_cartesian):
"""
Cartesian coordinates with fix... | 1,830 | 26.742424 | 72 | py |
plotnine | plotnine-main/plotnine/coords/coord_trans.py | from __future__ import annotations
import typing
from types import SimpleNamespace as NS
from typing import overload
from warnings import warn
from ..exceptions import PlotnineWarning
from ..iapi import panel_ranges, panel_view
from ..positions.position import transform_position
from .coord import coord, dist_euclide... | 5,141 | 28.551724 | 79 | py |
plotnine | plotnine-main/plotnine/coords/__init__.py | """
Coordinates
"""
from .coord_cartesian import coord_cartesian
from .coord_fixed import coord_equal, coord_fixed
from .coord_flip import coord_flip
from .coord_trans import coord_trans
__all__ = (
"coord_cartesian",
"coord_fixed",
"coord_equal",
"coord_flip",
"coord_trans",
)
| 300 | 17.8125 | 49 | py |
plotnine | plotnine-main/plotnine/coords/coord.py | from __future__ import annotations
import typing
from copy import copy
import numpy as np
from ..iapi import panel_ranges
if typing.TYPE_CHECKING:
from typing import Any
import numpy.typing as npt
import pandas as pd
from plotnine.iapi import labels_view, panel_view
from plotnine.typing import... | 6,689 | 26.644628 | 79 | py |
plotnine | plotnine-main/plotnine/themes/theme.py | from __future__ import annotations
import typing
from copy import copy, deepcopy
from typing import overload
from ..exceptions import PlotnineError
from ..options import get_option, set_option
from .themeable import Themeables, themeable
if typing.TYPE_CHECKING:
from typing import Any, Type
from plotnine.ty... | 12,684 | 28.16092 | 76 | py |
plotnine | plotnine-main/plotnine/themes/theme_xkcd.py | from copy import copy, deepcopy
from .elements import element_blank, element_line, element_rect, element_text
from .theme import theme
from .theme_gray import theme_gray
class theme_xkcd(theme_gray):
"""
xkcd theme
Parameters
----------
base_size : int, optional
Base font size. All text ... | 3,432 | 31.695238 | 78 | py |
plotnine | plotnine-main/plotnine/themes/theme_matplotlib.py | from ..options import get_option
from .elements import element_rect, element_text
from .theme import theme
class theme_matplotlib(theme):
"""
The default matplotlib look and feel.
The theme can be used (and has the same parameter
to customize) like a :class:`matplotlib.rc_context` manager.
Param... | 3,897 | 30.691057 | 79 | py |
plotnine | plotnine-main/plotnine/themes/theme_dark.py | from .elements import element_blank, element_line, element_rect, element_text
from .theme import theme
from .theme_gray import theme_gray
class theme_dark(theme_gray):
"""
The dark cousin of :class:`theme_light`
It has similar line sizes but a dark background. Useful to
make thin colored lines pop o... | 1,293 | 35.971429 | 79 | py |
plotnine | plotnine-main/plotnine/themes/theme_linedraw.py | from .elements import element_blank, element_line, element_rect, element_text
from .theme import theme
from .theme_gray import theme_gray
class theme_linedraw(theme_gray):
"""
A theme with only black lines of various widths on white backgrounds
Parameters
----------
base_size : int, optional
... | 1,339 | 38.411765 | 79 | py |
plotnine | plotnine-main/plotnine/themes/themeable.py | """
Provide theamables, the elements of plot can be style with theme()
From the ggplot2 documentation the axis.title inherits from text.
What this means is that axis.title and text have the same elements
that may be themed, but the scope of what they apply to is different.
The scope of text covers all text in the plot... | 47,282 | 23.768465 | 79 | py |
plotnine | plotnine-main/plotnine/themes/seaborn_rcmod.py | # type: ignore
"""Functions that alter the matplotlib rc dictionary on the fly."""
import functools
import matplotlib as _mpl
# https://github.com/mwaskom/seaborn/blob/master/seaborn/rcmod.py
# License: BSD-3-Clause License
#
# Modifications
# ---------------
# modified set_theme()
# removed set_palette(), reset_d... | 15,129 | 27.764259 | 81 | py |
plotnine | plotnine-main/plotnine/themes/theme_minimal.py | from .elements import element_blank
from .theme import theme
from .theme_bw import theme_bw
class theme_minimal(theme_bw):
"""
A minimalistic theme with no background annotations
Parameters
----------
base_size : int, optional
Base font size. All text sizes are a scaled versions of
... | 868 | 27.966667 | 63 | py |
plotnine | plotnine-main/plotnine/themes/theme_void.py | from ..options import get_option
from .elements import element_blank, element_text
from .theme import theme
class theme_void(theme):
"""
A classic-looking theme, with x & y axis lines and
no gridlines.
Parameters
----------
base_size : int, optional
Base font size. All text sizes are ... | 3,537 | 30.309735 | 71 | py |
plotnine | plotnine-main/plotnine/themes/theme_seaborn.py | from ..options import get_option
from .elements import element_rect, element_text
from .theme import theme
class theme_seaborn(theme):
"""
Theme for seaborn.
Credit to Michael Waskom's seaborn:
- http://stanford.edu/~mwaskom/software/seaborn
- https://github.com/mwaskom/seaborn
Para... | 4,277 | 30.226277 | 74 | py |
plotnine | plotnine-main/plotnine/themes/theme_bw.py | from .elements import element_line, element_rect, element_text
from .theme import theme
from .theme_gray import theme_gray
class theme_bw(theme_gray):
"""
White background with black gridlines
Parameters
----------
base_size : int, optional
Base font size. All text sizes are a scaled vers... | 1,066 | 32.34375 | 69 | py |
plotnine | plotnine-main/plotnine/themes/theme_classic.py | from .elements import element_blank, element_line, element_rect
from .theme import theme
from .theme_bw import theme_bw
class theme_classic(theme_bw):
"""
A classic-looking theme, with x & y axis lines and no gridlines
Parameters
----------
base_size : int, optional
Base font size. All te... | 907 | 30.310345 | 79 | py |
plotnine | plotnine-main/plotnine/themes/theme_tufte.py | from .elements import element_blank
from .theme import theme
from .theme_bw import theme_bw
class theme_tufte(theme_bw):
"""
Tufte Maximal Data, Minimal Ink Theme
Theme based on Chapter 6 'Data-Ink Maximization and Graphical
Design of Edward Tufte *The Visual Display of Quantitative
Information*.... | 1,912 | 34.425926 | 74 | py |
plotnine | plotnine-main/plotnine/themes/theme_538.py | from .elements import element_blank, element_line, element_rect, element_text
from .theme import theme
from .theme_gray import theme_gray
class theme_538(theme_gray):
"""
Theme in the likeness of fivethirtyeight.com plots
Parameters
----------
base_size : int, optional
Base font size. All... | 1,232 | 33.25 | 78 | py |
plotnine | plotnine-main/plotnine/themes/__init__.py | from .elements import element_blank, element_line, element_rect, element_text
from .theme import theme, theme_get, theme_set, theme_update
from .theme_538 import theme_538
from .theme_bw import theme_bw
from .theme_classic import theme_classic
from .theme_dark import theme_dark
from .theme_gray import theme_gray, theme... | 1,105 | 25.97561 | 77 | py |
plotnine | plotnine-main/plotnine/themes/elements.py | """
Theme elements used to decorate the graph.
"""
from __future__ import annotations
import typing
from contextlib import suppress
from dataclasses import dataclass
if typing.TYPE_CHECKING:
from typing import Any, Callable, Literal, Optional, Sequence
from plotnine.typing import Theme, TupleFloat3, TupleFlo... | 10,833 | 28.202156 | 76 | py |
plotnine | plotnine-main/plotnine/themes/theme_gray.py | from ..options import get_option
from ..utils import alias
from .elements import element_blank, element_line, element_rect, element_text
from .theme import theme
class theme_gray(theme):
"""
A gray background with white gridlines.
This is the default theme
Parameters
----------
base_size : i... | 5,730 | 34.376543 | 77 | py |
plotnine | plotnine-main/plotnine/themes/theme_light.py | from .elements import element_blank, element_line, element_rect, element_text
from .theme import theme
from .theme_gray import theme_gray
class theme_light(theme_gray):
"""
A theme similar to :class:`theme_linedraw`
Has light grey lines lines and axes to direct more attention
towards the data.
P... | 1,383 | 35.421053 | 77 | py |
plotnine | plotnine-main/plotnine/data/__init__.py | """
Plotnine Data
"""
from pathlib import Path
import pandas as pd
from pandas.api.types import CategoricalDtype
__all__ = (
"diamonds",
"economics",
"economics_long",
"faithful",
"faithfuld",
"huron",
"luv_colours",
"meat",
"midwest",
"mpg",
"msleep",
"mtcars",
"pa... | 14,835 | 27.098485 | 78 | py |
plotnine | plotnine-main/plotnine/facets/facet_null.py | from __future__ import annotations
import typing
from .facet import facet, layout_null
if typing.TYPE_CHECKING:
import pandas as pd
class facet_null(facet):
"""
A single Panel
Parameters
----------
shrink : bool
Whether to shrink the scales to the output of the
statistics i... | 756 | 20.027778 | 76 | py |
plotnine | plotnine-main/plotnine/facets/facet_grid.py | from __future__ import annotations
import typing
import pandas as pd
from ..exceptions import PlotnineError
from ..utils import add_margins, cross_join, join_keys, match, ninteraction
from .facet import (
add_missing_facets,
combine_vars,
eval_facet_vars,
facet,
layout_null,
)
from .strips import... | 9,838 | 31.153595 | 78 | py |
plotnine | plotnine-main/plotnine/facets/strips.py | from __future__ import annotations
import typing
from contextlib import suppress
from typing import List
from ..iapi import strip_draw_info, strip_label_details
if typing.TYPE_CHECKING:
from plotnine.iapi import layout_details
from plotnine.typing import (
Axes,
Facet,
Layout,
... | 6,228 | 29.091787 | 78 | py |
plotnine | plotnine-main/plotnine/facets/layout.py | from __future__ import annotations
import typing
from contextlib import suppress
import numpy as np
import pandas as pd
from ..exceptions import PlotnineError
from ..iapi import labels_view, layout_details, pos_scales
from ..utils import match
if typing.TYPE_CHECKING:
from plotnine.iapi import panel_view
fr... | 8,725 | 27.51634 | 78 | py |
plotnine | plotnine-main/plotnine/facets/labelling.py | from __future__ import annotations
import typing
from abc import ABCMeta, abstractmethod
from ..exceptions import PlotnineError
from ..iapi import strip_label_details
if typing.TYPE_CHECKING:
from typing import Callable, Optional
from ..typing import (
CanBeStripLabellingFunc,
StripLabelling... | 8,379 | 26.119741 | 79 | py |
plotnine | plotnine-main/plotnine/facets/__init__.py | """
Facets
"""
from .facet_grid import facet_grid
from .facet_null import facet_null
from .facet_wrap import facet_wrap
from .labelling import (
as_labeller,
label_both,
label_context,
label_value,
labeller,
)
__all__ = (
"facet_grid",
"facet_null",
"facet_wrap",
"label_value",
... | 392 | 14.72 | 34 | py |
plotnine | plotnine-main/plotnine/facets/facet_wrap.py | from __future__ import annotations
import re
import typing
from warnings import warn
import numpy as np
import pandas as pd
from ..exceptions import PlotnineError, PlotnineWarning
from ..utils import join_keys, match
from .facet import (
add_missing_facets,
combine_vars,
eval_facet_vars,
facet,
l... | 8,526 | 28.607639 | 78 | py |
plotnine | plotnine-main/plotnine/facets/facet.py | from __future__ import annotations
import itertools
import types
import typing
from copy import copy, deepcopy
import numpy as np
import pandas as pd
import pandas.api.types as pdtypes
from ..exceptions import PlotnineError
from ..scales.scales import Scales
from ..utils import cross_join, match
from .strips import ... | 20,150 | 29.076119 | 79 | py |
plotnine | plotnine-main/plotnine/stats/smoothers.py | import warnings
from contextlib import suppress
import numpy as np
import pandas as pd
from ..exceptions import PlotnineError, PlotnineWarning
from ..utils import get_valid_kwargs
def predictdf(data, xseq, **params):
"""
Make prediction on the data
This is a general function responsible for dispatching... | 16,034 | 26.790295 | 79 | py |
plotnine | plotnine-main/plotnine/stats/stat_ellipse.py | from __future__ import annotations
import typing
from warnings import warn
import numpy as np
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineWarning
from .stat import stat
if typing.TYPE_CHECKING:
from typing import Any, Optional
from plotnine.typing import FloatArrayL... | 7,661 | 28.697674 | 75 | py |
plotnine | plotnine-main/plotnine/stats/distributions.py | import scipy.stats as stats
from ..exceptions import PlotnineError
def _hasattrs(obj, attrs):
return all(hasattr(obj, attr) for attr in attrs)
# Continuous univariate
continuous = {
k for k in dir(stats) if _hasattrs(getattr(stats, k), ("pdf", "cdf"))
}
# Discrete univariate
discrete = {k for k in dir(sta... | 1,148 | 21.529412 | 73 | py |
plotnine | plotnine-main/plotnine/stats/stat_boxplot.py | import numpy as np
import pandas as pd
import pandas.api.types as pdtypes
from ..doctools import document
from ..utils import resolution
from .stat import stat
@document
class stat_boxplot(stat):
"""
Compute boxplot statistics
{usage}
Parameters
----------
{common_parameters}
coef : flo... | 5,987 | 25.852018 | 77 | py |
plotnine | plotnine-main/plotnine/stats/density.py | """
Kernel Density Functions
These functions make it easy to integrate stats that compute
kernel densities with the wider scientific python ecosystem.
Credit: Jake VanderPlas for the original kde_* functions
https://jakevdp.github.io/blog/2013/12/01/kernel-density-estimation/
"""
import numpy as np
import pandas.api... | 6,039 | 25.60793 | 74 | py |
plotnine | plotnine-main/plotnine/stats/stat_ecdf.py | import numpy as np
import pandas as pd
from ..doctools import document
from ..mapping.evaluation import after_stat
from .stat import stat
@document
class stat_ecdf(stat):
"""
Emperical Cumulative Density Function
{usage}
Parameters
----------
{common_parameters}
n : int (default: None)... | 1,361 | 20.619048 | 74 | py |
plotnine | plotnine-main/plotnine/stats/stat_identity.py | from ..doctools import document
from .stat import stat
@document
class stat_identity(stat):
"""
Identity (do nothing) statistic
{usage}
Parameters
----------
{common_parameters}
"""
DEFAULT_PARAMS = {"geom": "point", "position": "identity", "na_rm": False}
@classmethod
def ... | 384 | 16.5 | 78 | py |
plotnine | plotnine-main/plotnine/stats/stat_density_2d.py | import numpy as np
import pandas as pd
from ..doctools import document
from .density import get_var_type, kde
from .stat import stat
@document
class stat_density_2d(stat):
"""
Compute 2D kernel density estimation
{usage}
Parameters
----------
{common_parameters}
contour : bool
W... | 5,556 | 29.037838 | 70 | py |
plotnine | plotnine-main/plotnine/stats/stat_sina.py | import numpy as np
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineError
from ..mapping.aes import has_groups
from ..mapping.evaluation import after_stat
from ..utils import array_kind, jitter, resolution
from .binning import breaks_from_bins, breaks_from_binwidth
from .stat import... | 8,076 | 31.437751 | 78 | py |
plotnine | plotnine-main/plotnine/stats/stat_pointdensity.py | import numpy as np
import pandas as pd
from ..doctools import document
from ..mapping.evaluation import after_stat
from .density import get_var_type, kde
from .stat import stat
@document
class stat_pointdensity(stat):
"""
Compute density estimation for each point
{usage}
Parameters
----------
... | 2,150 | 24.011628 | 68 | py |
plotnine | plotnine-main/plotnine/stats/stat_bin.py | from warnings import warn
import numpy as np
from ..doctools import document
from ..exceptions import PlotnineError, PlotnineWarning
from ..mapping.evaluation import after_stat
from .binning import (
assign_bins,
breaks_from_bins,
breaks_from_binwidth,
freedman_diaconis_bins,
)
from .stat import stat
... | 4,691 | 32.042254 | 75 | py |
plotnine | plotnine-main/plotnine/stats/stat_qq_line.py | import numpy as np
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineError
from .stat import stat
from .stat_qq import stat_qq
@document
class stat_qq_line(stat):
"""
Calculate line through quantile-quantile plot
{usage}
Parameters
----------
{common_param... | 3,313 | 31.490196 | 76 | py |
plotnine | plotnine-main/plotnine/stats/stat_summary.py | import numpy as np
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineError
from ..utils import get_valid_kwargs, uniquecols
from .stat import stat
def bootstrap_statistics(
series,
statistic,
n_samples=1000,
confidence_interval=0.95,
random_state=None,
):
""... | 9,325 | 27.607362 | 79 | py |
plotnine | plotnine-main/plotnine/stats/stat_count.py | import numpy as np
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineError
from ..mapping.evaluation import after_stat
from ..utils import resolution
from .stat import stat
@document
class stat_count(stat):
"""
Counts the number of cases at each x position
{usage}
... | 2,004 | 23.753086 | 79 | py |
plotnine | plotnine-main/plotnine/stats/stat_hull.py | import numpy as np
import pandas as pd
from ..doctools import document
from .stat import stat
@document
class stat_hull(stat):
"""
2 Dimensional Convex Hull
{usage}
Parameters
----------
{common_parameters}
qhull_options: str, optional
Additional options to pass to Qhull.
... | 1,447 | 20.61194 | 67 | py |
plotnine | plotnine-main/plotnine/stats/stat_quantile.py | from warnings import warn
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineWarning
from .stat import stat
# method_args are any of the keyword args (other than q) for
# statsmodels.regression.quantile_regression.QuantReg.fit
@document
class stat_quantile(stat):
"""
Comput... | 2,521 | 25.270833 | 74 | py |
plotnine | plotnine-main/plotnine/stats/stat_sum.py | from ..doctools import document
from ..mapping.aes import ALL_AESTHETICS
from ..mapping.evaluation import after_stat
from ..utils import groupby_apply
from .stat import stat
@document
class stat_sum(stat):
"""
Sum unique values
Useful for overplotting on scatterplots.
{usage}
Parameters
---... | 1,657 | 24.121212 | 78 | py |
plotnine | plotnine-main/plotnine/stats/stat.py | from __future__ import annotations
import typing
from copy import deepcopy
import pandas as pd
from ..exceptions import PlotnineError
from ..layer import layer
from ..mapping import aes
from ..utils import (
Registry,
check_required_aesthetics,
copy_keys,
data_mapping_as_kwargs,
groupby_apply,
... | 11,605 | 26.699284 | 79 | py |
plotnine | plotnine-main/plotnine/stats/stat_bindot.py | from __future__ import annotations
from warnings import warn
import numpy as np
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineError, PlotnineWarning
from ..mapping.evaluation import after_stat
from ..utils import groupby_apply
from .binning import (
assign_bins,
breaks_... | 10,333 | 31.394984 | 77 | py |
plotnine | plotnine-main/plotnine/stats/stat_qq.py | import numpy as np
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineError
from ..mapping.evaluation import after_stat
from .stat import stat
# Note: distribution should be a name from scipy.stat.distribution
@document
class stat_qq(stat):
"""
Calculation for quantile-quant... | 2,883 | 30.692308 | 77 | py |
plotnine | plotnine-main/plotnine/stats/__init__.py | """
Statistics
"""
from .stat_bin import stat_bin
from .stat_bin_2d import stat_bin2d, stat_bin_2d
from .stat_bindot import stat_bindot
from .stat_boxplot import stat_boxplot
from .stat_count import stat_count
from .stat_density import stat_density
from .stat_density_2d import stat_density_2d
from .stat_ecdf import sta... | 1,385 | 24.666667 | 48 | py |
plotnine | plotnine-main/plotnine/stats/stat_ydensity.py | from contextlib import suppress
import numpy as np
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineError
from .stat import stat
from .stat_density import compute_density, stat_density
@document
class stat_ydensity(stat):
"""
Density estimate
{usage}
Parameters
... | 5,655 | 28.612565 | 75 | py |
plotnine | plotnine-main/plotnine/stats/stat_function.py | from __future__ import annotations
import typing
import numpy as np
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineError
from ..mapping.evaluation import after_stat
from ..scales.scale import scale_continuous
from .stat import stat
if typing.TYPE_CHECKING:
from typing impor... | 3,171 | 23.589147 | 77 | py |
plotnine | plotnine-main/plotnine/stats/stat_smooth.py | import warnings
import numpy as np
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineWarning
from .smoothers import predictdf
from .stat import stat
@document
class stat_smooth(stat):
"""
Calculate a smoothed conditional mean
{usage}
Parameters
----------
... | 8,108 | 33.802575 | 74 | py |
plotnine | plotnine-main/plotnine/stats/binning.py | from __future__ import annotations
import typing
import numpy as np
import pandas as pd
from ..exceptions import PlotnineError
from ..scales.scale import scale_discrete
if typing.TYPE_CHECKING:
from typing import Optional
from plotnine.typing import FloatArray, TupleFloat2
__all__ = (
"freedman_diaco... | 9,304 | 26.859281 | 78 | py |
plotnine | plotnine-main/plotnine/stats/stat_bin_2d.py | import itertools
import types
import numpy as np
import pandas as pd
from ..doctools import document
from ..mapping.evaluation import after_stat
from ..utils import is_scalar_or_string
from .binning import fuzzybreaks
from .stat import stat
@document
class stat_bin_2d(stat):
"""
2 Dimensional bin counts
... | 5,333 | 27.677419 | 73 | py |
plotnine | plotnine-main/plotnine/stats/stat_density.py | from contextlib import suppress
from warnings import warn
import numpy as np
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineError, PlotnineWarning
from ..mapping.evaluation import after_stat
from .stat import stat
# NOTE: Parameter discriptions are in
# statsmodels/nonparametri... | 7,624 | 27.136531 | 75 | py |
plotnine | plotnine-main/plotnine/stats/stat_unique.py | from ..doctools import document
from .stat import stat
@document
class stat_unique(stat):
"""
Remove duplicates
{usage}
Parameters
----------
{common_parameters}
"""
DEFAULT_PARAMS = {"geom": "point", "position": "identity", "na_rm": False}
@classmethod
def compute_panel(cl... | 386 | 16.590909 | 78 | py |
plotnine | plotnine-main/plotnine/stats/stat_summary_bin.py | import numpy as np
import pandas as pd
from ..doctools import document
from ..exceptions import PlotnineWarning
from ..scales.scale import scale_discrete
from ..utils import groupby_apply
from .binning import fuzzybreaks
from .stat import stat
from .stat_summary import make_summary_fun
@document
class stat_summary_b... | 5,803 | 33.141176 | 75 | py |
plotnine | plotnine-main/plotnine/mapping/__init__.py | """
Aesthetic Mappings
"""
from .aes import aes
from .evaluation import after_scale, after_stat, stage
__all__ = ("aes", "after_stat", "after_scale", "stage")
| 160 | 19.125 | 55 | py |
plotnine | plotnine-main/plotnine/mapping/aes.py | from __future__ import annotations
import re
from collections.abc import Iterable
from contextlib import suppress
from copy import deepcopy
from dataclasses import fields
from typing import Any, Dict, overload
import pandas as pd
from ..iapi import labels_view
from .evaluation import after_stat, stage
__all__ = ("a... | 15,913 | 24.061417 | 77 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.