Repository navigation
chore(r): render on R 4.6.1 with ggplot2 4.0.3 - #12242
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The shared rendering environment upgrade needs human sign-off because installation and rendering through the actual GitHub Actions pipeline remain unverified.
No open issues 🎉
What changed in this PR
Updates the shared R rendering environment to R 4.6.1 and ggplot2 4.0.3, with generator guidance for changed APIs and rendering defaults. Existing catalogue images remain unchanged until regeneration.
Changes:
- Advances the R runtime and Posit snapshot to 2026-10-20.
- Adds ggplot2 4.0 migration guidance for generated implementations.
- Updates displayed versions and records the upgrade, with merge coordination documented for #12240.
| File | Description |
|---|---|
prompts/library/ggplot2.md |
Adds ggplot2 4.0 API and rendering guidance. |
core/constants.py |
Updates displayed R and ggplot2 versions. |
changelog.d/r-4.6-ggplot2-4.md |
Records the upgrade and catalogue impact. |
.github/actions/setup-r/action.yml |
Pins R 4.6.1 and the newer package snapshot. |
Review effort: Balanced
The shared setup-r action installs R 4.6.1 (was 4.4.1) and pins the Posit Package Manager snapshot to 2026-10-20 (was 2025-01-15), which moves ggplot2 from 3.5.1 to 4.0.3. Every package in the list installs as a noble binary for R 4.6.1 from that snapshot. All 325 ggplot2 implementations render in both themes before and after (container run mirroring the action). The ggplot2 generator prompt gains a "ggplot2 4.0 rules" section for the changes that render differently without an error: label borders, binning edges, theme_void() borders, rotated top-axis text, legend order, fatten/draw_quantiles/errorbarh deprecations. core/constants.py shows ggplot2 4.0.3 and R 4.6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rename the section to notes so the reviewer, which also reads this file, does not take it as a scoring rubric. Spell out the facet_wrap(dir) layout that replaces as.table = FALSE (checked: identical panel layout), and add the annotation_borders() rename and plot.tag inheritance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mpts After #12240 every locked library's prompt names the major it writes against; tests/unit/core/test_version_sources.py holds ggplot2's line to the snapshot note in the setup-r action (4.0.3, so API level 4). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0175hA62juZoajMcqKxWFGza
MarkusNeusinger
force-pushed
the
chore/r-4.6-ggplot2-4
branch
from
October 23, 2026 10:03
75312f2 to
8e50343
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
**API level:** ggplot2 4.line toprompts/library/ggplot2.md. The displayed versions follow the pins since refactor: derive library versions from pins, install from uv.lock #12240: the setup-r note# Snapshot 2026-10-20 ships ggplot2 4.0.3.and ther-versiondefault give ggplot2 4.0.3 and R 4.6, andcore/constants.pyis unchanged.plots/file. Catalogue images stay as rendered until an implementation is regenerated.Rebased on #12240
The branch is rebased on main after #12240.
core/constants.pykeeps main's version-free entries, and the setup-r action carries #12240's snapshot-note paragraph with the new date and version.tests/unit/core/test_version_sources.pypasses, including the ggplot2 API level check, andpinned_versions()returns ggplot2 4.0.3 and R 4.6 with no errors.Plan
N/A
Before and after renders
Both environments are Ubuntu 24.04 containers built like the action: R from the Posit builds through rig (what
r-lib/actions/setup-rinstalls), the action's apt list plusfonts-dejavu-coreandfonts-liberation, and the action'sinstall.packages()call against the snapshot with the binary user agent. Each implementation ran the wayimpl-generateruns it:cd plots/<spec>/implementations/r && ANYPLOT_THEME=<light|dark> Rscript ggplot2.R. All 325 implementations ran, so no sample was needed.Pixel comparison of the 650 pairs (every pair has the same size):
A changed pair counts as a layout shift when under 0.01 % of its pixels lack a colour match (per-channel tolerance 24) within a 20 px window of the other render. Every pair above that threshold was inspected by eye. Most shifts come from one 4.0 change:
guide_axis()no longer reserves space for blank ticks, andtheme_minimal()andtheme_void()blank them, so panels grow by about 11 px per axis (2 pt at 400 dpi).The ten largest raw diffs (share of pixels with a channel delta above 32) are all layout shifts of unchanged content: horizon-basic 14.5 %, scatter-matrix 13.9 %, psychrometric-basic 13.2 %, parallel-basic 10.5 %, scatter-pitch-events 10.2 %, parallel-categories-basic 9.3 %, indicator-ichimoku 9.2 %, scatter-embedding 9.0 %, column-stratigraphic 8.8 % and line-timeseries-rolling 7.6 %.
Content-level changes, none of them a failure:
theme_void()rootrectnow haslinewidth = 0, so the legend frame disappearsvjust = 0restores the 3.5.1 layout exactly (tested)annotate("label", label.size = 0)is ignored, so 0.25 mm borders appeargeom_qq_line()is now an abline across the panelNo implementation broke: every render succeeded, and the only new log lines are deprecation warnings and
Ignoring unknown parameters: label.size.Breaking changes handled
The new prompt section tells the generator to use
linewidth/border.colouron labels instead oflabel.size,geom_errorbar(orientation = "y")instead ofgeom_errorbarh(), the part-specific line widths instead offatten,quantilesplusquantile.linetypeinstead ofdraw_quantiles,coord_transform()andannotation_borders()instead of the renamed forms, and a two-letterfacet_wrap(dir = )instead ofas.table. It also covers four silent default changes: anchor bins withboundary, give bordered rects undertheme_void()an explicitlinewidth, setvjust = 0on rotated top-axis text, and fix legend order withguide_legend(order = ). Each replacement was checked in the 4.0.3 container.First review (Gemini 3.8 Flash)
facet_wrap(dir = )line now names the layout that replacesas.table = FALSE("lb", same panel layout, checked), and theannotation_borders()rename andplot.taginheritance were added.libtiff5-devmissing on noble (the package exists there),geom_crossbar(middle.linewidth = )unverified (it runs without a warning and is the replacement the 4.0.3 deprecation message names), and the template theme needing explicit border widths (it usestheme_minimal(), whose rect line width is non-zero).Regeneration candidates
geom_errorbarh), violin-basic (draw_quantiles), strip-basic (fatten), andlabel.sizein line-annotated-events, bode-basic, contour-map-geographic, scatter-embedding, network-transport-static, shap-waterfall, network-force-directed, network-directed, scatter-ashby-material, ternary-basic and tree-decision.These matter only when
daily-regenorimpl-repairre-renders an implementation; this PR re-renders nothing.Pre-existing gaps, unchanged by this PR
hexbin, so in an environment built from the action alone hexbin-basic and hexbin-map-geographic warn and draw no hexes, before and after.maps(map-projections, flowmap-origin-destination) orqrcode(qrcode-basic). Both containers added them as test-only extras.These packages go to a separate task, not into this PR.
Verification gaps
The
.github/actions/setup-rchange has no live verification loop beyond the container run above. The first real check is the nextimpl-generate,impl-repairordaily-regenjob on an R implementation after merge. Noreview-retest.ymlarm is needed: the "ggplot2 4.0 notes" section is generation guidance, not a review rule, even though the review step also readsprompts/library/ggplot2.md.Test plan
ruff check,ruff format --check, mypy,pytest tests/unit tests/integration(12,331 passed after the rebase) and the changelog check