Skip to content

Add Box Plot and Heatmap rows to the comparison - #31

Merged
tdhopper merged 3 commits into
content-refreshfrom
new-plots
Aug 5, 2026
Merged

Add Box Plot and Heatmap rows to the comparison#31
tdhopper merged 3 commits into
content-refreshfrom
new-plots

Conversation

@tdhopper

@tdhopper tdhopper commented Aug 5, 2026

Copy link
Copy Markdown
Owner

TL;DR

Two new plot rows — Box Plot (hwy by class, 9 of 10 columns) and Heatmap (diamonds cut × clarity counts, 8 of 10) — bringing the site to 15 rows and 136 example cells. Gaps are API-honest: seaborn.objects has no boxplot or rect mark (verified against 0.13.2's mark list), and pandas .plot has no heatmap.

Stacked on #30 (content-refresh).

Files to review (4):

File Why
Examples.ipynb (start here) 17 new cells plus two section headings; Box Plot sits after Histogram, Heatmap last.
render.py Two entries in the names dict (order controls page placement).
tests/test_plots.py Both slugs with exactly the implemented packages.
INTRO.md Per-library coverage counts updated for the new rows.

Reviewer notes

  • geom_bin2d() is a trap on two discrete axes: it bins the integer factor positions with a continuous binwidth, yielding tiny disconnected tiles, and forcing binwidth=c(1,1) misaligns tiles against tick labels by half a cell. The ggplot2/plotnine/lets-plot heatmaps use the R4DS idiom instead — count, then geom_tile — which also mirrors the pivot-then-draw shape of the matplotlib/seaborn/hvPlot columns. Altair and plotly keep their built-in count aggregation, idiomatic there.
  • Tick labels checked at render size: clarity labels rotated 45° where the library doesn't handle it (pandas, matplotlib, seaborn, hvPlot); ggplot2's fit unrotated.

Verified: notebook executes clean, 136/136 cells emit PNGs with zero error outputs, render + pytest pass, spot-checked ten of the new images.

Box plot shows hwy by class from mpg; heatmap shows diamonds counts by cut
and clarity. seaborn.objects is skipped for both: 0.13 has no boxplot mark
and no rect mark, and pandas has no heatmap.
ggplot2's geom_bin2d bins discrete positions with a continuous binwidth, so
the R heatmap came out as tiny disconnected tiles. Counting first and drawing
geom_tile is the idiomatic recipe and matches the pivot-then-draw approach the
matplotlib, seaborn, and hvPlot columns already take. Also stop seaborn from
rotating the clarity labels.
@tdhopper
tdhopper marked this pull request as ready for review August 5, 2026 11:49
@tdhopper
tdhopper merged commit a57a9e5 into content-refresh Aug 5, 2026
1 check passed
tdhopper added a commit that referenced this pull request Aug 5, 2026
Land the Box Plot and Heatmap rows stranded by the stacked merge of #31
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