Skip to content

Docs: add plotnine tabsets, fix import collisions, standardize headings - #14

Merged
drbenvincent merged 5 commits into
mainfrom
issue-12-plotnine-docs
Jul 4, 2026
Merged

Docs: add plotnine tabsets, fix import collisions, standardize headings#14
drbenvincent merged 5 commits into
mainfrom
issue-12-plotnine-docs

Conversation

@drbenvincent

@drbenvincent drbenvincent commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

Gives plotnine and lets-plot equal treatment across all example pages using Quarto panel-tabsets, fixes a critical bug where lets-plot tabs silently used plotnine's ggplot, and adds consistent heading structure to separate tidydraws data transformation from plotting.

Changes

Bug fix

  • Import namespace collisionfrom lets_plot import (...) followed by from plotnine import (...) in the same cell shadowed ggplot, aes, labs, facet_wrap, theme_minimal, scale_color_gradient with plotnine's versions. Lets-plot tabs were using plotnine's ggplot with lets-plot geoms → LayerSpec.__radd__ error. Fixed by switching to module-prefixed imports (import lets_plot as lp / import plotnine as p9) across all 4 doc pages.
  • geom_density_2d(bins=...) — plotnine doesn't accept bins; removed from plotnine tabs in showcase.qmd.

New content

  • index.qmd — added .panel-tabset for lets-plot + plotnine (plotnine uses |// composition for 2x2 grid), plus installation tabset (uv / pip), plus point_interval() in the function table.
  • 04-showcase.qmd — all 9 plots now have lets-plot + plotnine tabs.

Heading standardization

  • Renamed ## Gallery## Plotting in 01, 02, 03 qmd files.
  • Added ### Use tidydraws subheadings in showcase sections 3, 7, 8 (consistent with other sections).
  • Split model creation from tidydraws extraction where they were combined in one code block.
  • Removed redundant ### Plot heading from showcase section 5.

Design

Each plot has two tabs — lets-plot and plotnine — both rendering from the same tidy draws. Data transformation (tidydraws calls, point_interval, etc.) runs once outside the tabsets under a Use tidydraws heading, so the reader can see where tidydraws fits in the pipeline separate from plotting code.

Closes #12

Each example page now uses Quarto panel-tabsets to give plotnine and
lets-plot equal treatment. Data transformation (tidydraws) cells remain
outside the tabsets — only the ggplot rendering code is duplicated.

Closes #12.
@drbenvincent
drbenvincent force-pushed the issue-12-plotnine-docs branch from c33bb8a to 288357e Compare July 4, 2026 18:32
- Replace bare from-plotnine/lets-plot imports with module-prefixed
  (import lets_plot as lp / import plotnine as p9) across all doc pages
- Fix lets-plot tab code incorrectly using plotnine's ggplot
- Remove unsupported bins param from plotnine's geom_density_2d
- Add plotnine 2x2 grid composition to index.qmd (| and / operators)
- Add installation tabset (uv / pip) to index.qmd
- Add point_interval() to the function table in index.qmd
- Split data transform from plotting code in index.qmd
- Rename ## Gallery → ## Plotting in 01, 02, 03 qmd files
- Add ### Use tidydraws heading to showcase sections 3, 7, 8
- Split model creation from tidydraws extraction in showcase sections 3, 7, 8
- Remove redundant ### Plot heading in showcase section 5, merge data prep into ### Use tidydraws
@drbenvincent
drbenvincent marked this pull request as ready for review July 4, 2026 19:40
@drbenvincent drbenvincent changed the title Docs: add plotnine tabs alongside lets-plot examples Docs: add plotnine tabsets, fix import collisions, standardize headings Jul 4, 2026
- Remove from tidydraws import point_interval in 01 and 03
- Replace all bare point_interval() calls with td.point_interval()
@drbenvincent
drbenvincent merged commit 89ea6fb into main Jul 4, 2026
7 checks passed
@drbenvincent
drbenvincent deleted the issue-12-plotnine-docs branch July 4, 2026 20:06
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.

Docs: more equal treatment of plotnine and lets-plot

1 participant