gitmyhub

ggpy

Python ★ 3.7k updated 3y ago ▣ archived

ggplot port for python

A Python library that brings ggplot-style layered charting to Python, letting you build charts by chaining components together with plus signs instead of switching to R.

PythonJupyterpipcondasetup: easycomplexity 2/5

This project brings ggplot-style charting to Python. Ggplot is a well-known approach to building charts that originated in R, where you describe a chart by layering components: the data, how variables map to visual properties like color and position, and what kind of shape to draw (lines, bars, density curves, etc.). This Python library lets you use the same idea without having to switch to R.

The syntax works by chaining pieces together with plus signs. You start by specifying your data and how to map columns to chart properties, then add a geometry layer to choose the chart type, and optionally add color scales, themes, or facets to split the chart into panels by a category. The README shows a short example that creates a density chart of diamond prices, colored by clarity, with separate panels for each cut grade.

Installation is through pip or conda. The repository includes Jupyter notebooks with worked examples, a gallery, and how-to guides for specific chart types like scatter plots and histograms.

The README notes that this is not a direct copy of the R library. The goal is to bring the underlying idea of layered grammar-based charting to Python, not to reproduce every R-specific behavior. Some features overlap with ggplot2 in R, but the two are not identical.

The project appears to be community-maintained and the README is fairly brief. It does not cover the full list of supported geometry types or chart options beyond the single example shown, so the linked notebooks and gallery are the main place to learn what the library can do.

Where it fits