Demonstrating an alternative methods-based interface for plotnine.

This is a small Quarto site for Demonstrating an alternative methods-based interface for plotnine (which Codex insists on calling the “fluent” plotnine API). The plotnine used here comes from the codex-fluent-api branch on a fork of the official plotnine.

The basic idea is that from plotnine import * is no longer needed and that + with functions is replaced by method calls. One hope is that this makes plotnine feel more Pythonic. I wrote about the perception that plotnine is “not Pythonic” here.

The notebooks here adapt examples from the plotnine gallery and guide pages, with Polars used where it makes the data prep cleaner.

Guide Adaptations

Geometric Objects

Condenses the plotnine geoms guide into a notebook covering points, bars, rectangles, lines, ribbons, distributions, position adjustments, and summaries.

Aesthetic Mappings

Focuses on global versus layer-local aes(), literal settings, grouping, and expression-based mappings.

Scales, Legends, and Guides

Covers manual scales, breaks, labels, limits, legend merging, guide placement, and guide customization in the fluent API style.

Source Material

Most notebooks on this site are adapted from the official plotnine gallery and plotnine guides.