Skip to content

Add Lets-Plot column to the plotting comparison - #24

Merged
tdhopper merged 2 commits into
masterfrom
add-lets-plot
Aug 5, 2026
Merged

Add Lets-Plot column to the plotting comparison#24
tdhopper merged 2 commits into
masterfrom
add-lets-plot

Conversation

@tdhopper

@tdhopper tdhopper commented Aug 5, 2026

Copy link
Copy Markdown
Owner

TL;DR

Lets-Plot (JetBrains' ggplot2 port) joins the comparison as a new column: 13 example cells, one per plot on the site, bringing the total to 79. Its ggplot2-faithful API slots in next to plotnine; three cells differ from the R reference only in facet syntax (Lets-Plot has no formula interface).

Files to review (7, +339 / -15):

File Why
Examples.ipynb (start here) 13 new cells tagged package:lets-plot, plus setup-cell changes below.
render.py One line: lets-plot column ordered after plotnine so the grammar-of-graphics libraries sit together.
tests/test_plots.py lets-plot added to all 13 plot entries.
INTRO.md, CLAUDE.md Lets-Plot described in the site intro and project docs.

Reviewer notes

  • PNG export uses an IPython formatter, not per-cell boilerplate. The setup cell registers image/png for PlotSpec via ggsave to a temp dir, so every bare lp.ggplot(...) expression emits a PNG and the code shown on the site stays pure plotting code. Raster export is built into lets-plot 4.11+; no extra package.
  • Everything is lp.-prefixed because the notebook does from plotnine import *, which already owns ggplot/aes/geom_*. The bar-counts cell carries a site-visible note explaining this.
  • Fidelity: geom_smooth gives the true 95% CI band and a smooth loess (plotnine's loess note doesn't apply), and xlim works on the KDE plot (plotnine's doesn't). Facets use facets=/x=/y= kwargs instead of R formulas.

Verified end to end: notebook executes clean, 79/79 example cells emit PNGs, render.py succeeds, pytest passes.

Base automatically changed from fix-build to master August 5, 2026 01:09
Lets-Plot renders to PNG through ggsave; an IPython image/png formatter
registered on PlotSpec keeps the example cells free of export boilerplate.
It is imported as lp so its ggplot2-style names do not shadow plotnine's.
@tdhopper
tdhopper marked this pull request as ready for review August 5, 2026 01:10
@tdhopper
tdhopper merged commit cc92ad4 into master Aug 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant