Home

plotnine

Plotnine is a data visualization library for Python that implements the grammar of graphics, a declarative approach to building statistical graphics originally developed for R's ggplot2. It enables users to construct plots by mapping data variables to visual properties (aesthetics) and layering geometric and statistical components.

The library emphasizes core building blocks such as aesthetics mappings (aes), geometric objects (geoms), statistical transformations

Plotnine renders plots via matplotlib, allowing integration with the Python data ecosystem and interactive environments such

As an open-source project, plotnine is developed by contributors and hosted on public repositories. It provides

(stats),
scales,
coordinates,
facets,
and
themes.
Typical
plots
are
built
by
providing
a
data
frame
(usually
a
pandas
DataFrame)
and
adding
layers
like
geom_point,
geom_line,
or
geom_bar,
optionally
with
statistical
transformations
and
position
adjustments.
Faceting
allows
splitting
data
into
subplots,
and
themes
control
the
visual
style,
including
colors,
fonts,
and
axis
details.
as
Jupyter
notebooks.
It
supports
a
broad
range
of
geoms
and
stats,
and
can
interoperate
with
pandas,
numpy,
and
other
visualization
tools
within
data
analysis
workflows.
a
Pythonic
alternative
for
users
familiar
with
ggplot2
and
is
used
in
education,
data
analysis,
and
reproducible
research
to
produce
publication-quality
graphics
with
a
consistent,
grammar-driven
approach.