feat(plotting): Makie backend parity with the Plots backend - #540
Merged
Merged
Conversation
`CTBaseMakie` was a proof of concept (`render` only). Bring it level with `CTBasePlots` on the whole IR: - `seriestype` dispatch — `:steppost` → `Makie.stairs!(…; step=:post)`, `:scatter` → `Makie.scatter!`, `:path` → `Makie.lines!` (was: everything drawn as lines); - `z_order` — series drawn back-to-front, same `_z_rank` ordering as Plots; - `HLine` / `VLine` decorations via `Makie.hlines!` / `vlines!` with style translation (box bounds, initial/final-time markers); - user-kwarg partition — `(series_user, axes_user)`; axis attributes (`legend`, `ylims`, grid/scale/ticks) forwarded to every cell, unknown keys dropped; - real `render!` overlay — targets existing `Makie.Axis` blocks by deterministic leaf order; an empty target figure is filled as if by `render` (via the new `_render_into!`). `test_contract_makie.jl` mirrors `test_contract.jl` on the same IR fixture (overlay, decorations, stairs, forwarded attributes). Docs: `CairoMakie` docs dep, executed Makie `@example` in the plotting guide, `CTBaseMakie` on the API reference internals page. `make.jl` `warnonly` gains `:external_cross_references` so the self-referencing `InterLinks` bootstrap (first build produces `objects.inv`, second resolves) is non-fatal — matches CTModels.jl. Part of control-toolbox/CTModels.jl#408. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Aug 28, 2026
`_lower_split` sets `legend=false` on every cell (the component name is the y-label, not a legend entry). Both backends took that literally, so `plot(sol; label="s1")` set the series label but never showed it — a regression from the pre-engine recipe, where Plots auto-revealed the legend for any labelled series. It also affected the Makie backend, which dropped the `label` kwarg entirely (not in `_SERIES_USER_KEYS`). - `CTBaseMakie`: `:label` added to `_SERIES_USER_KEYS`; `_draw_into_axis!` shows the legend when a series carries a non-empty label (IR or user `label`). - `CTBasePlots`: `_draw_axes!` picks `:best` instead of `false` when a series is labelled (IR or user `label`). Default `:split` figures are unchanged (no labels → no legend). Part of control-toolbox/CTModels.jl#408. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The Backend Contract section and Function Reference already covered MakieBackend; the Architecture Overview diagram/prose and the "no backend loaded" note still mentioned only Plots. Bring them level, and add a "User Attributes: Series vs Axis" subsection explaining how each backend partitions user kwargs into series vs axis attributes — Plots introspects Plots.attributes(:Series), Makie uses curated whitelists and drops unknown keys. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Member
Author
Updates since the PR was opened
|
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.
Brings
CTBaseMakie(proof of concept,renderonly) to feature parity withCTBasePlots.What changed
ext/CTBaseMakie.jl:seriestypedispatch —:steppost→Makie.stairs!(…; step=:post),:scatter→Makie.scatter!,:path→Makie.lines!. Constant-interpolation controls now render as steps.z_order— series drawn back-to-front using the same_z_rankordering as the Plots backend.HLine/VLinedrawn viaMakie.hlines!/vlines!with style translation (box bounds,t0/tfmarkers)._partition_usersplits into(series_user, axes_user); axis attributes (legend,ylims, grid/scale/ticks) forwarded to every cell, unknown keys dropped. Makie exposes noattributes(:Series)analogue, so the split uses curated whitelists (_SERIES_USER_KEYS/_AXIS_USER_KEYS).render!overlay — real implementation: targets existingMakie.Axisblocks by deterministic leaf order; an empty target figure is filled as if byrender(new_render_into!helper, shared withrender).src/Plotting/contract.jl—MakieBackenddocstring drops the proof-of-concept caveat.test/suite/plotting/test_contract_makie.jl— POC assertions replaced by parity assertions mirroringtest_contract.jlon the same_figure()IR (overlay keeps axis count, decorations becomeHLines/VLines,:steppostbecomesStairs, forwarded attributes reach the axes).Follow-up commits on this branch
1a2624f—:splitcells hardcodelegend=false; a userlabel=(or an IR series label) now turns the legend back on, on both backends, so overlaid solutions can be told apart.1b71e9e— docs: name the Makie backend in the Architecture Overview + the "no backend loaded" note; new "User Attributes: Series vs Axis" section in the plotting guide documenting the per-backend kwarg split.Docs
CairoMakieadded todocs/Project.toml;make.jlloads it and registers:CTBaseMakie; the plotting guide gains an executed Makie@example;CTBaseMakieappears on the API reference internals page.make.jlwarnonlygains:external_cross_references. The self-referencingInterLinks"CTBase" entry cannot resolve symbols added since the last published inventory (hereMakieBackend, latent since feat(plotting): add Makie backend (proof of concept) #539) on a fresh checkout; per the Handbook self-reference pattern the first build completes-with-errors to produceobjects.inv, then a second build is clean. Matches CTModels.jl, which already sets this.Testing
Last full local run 2026-08-28 (
1b71e9e):test/suite/plotting— greenPart of control-toolbox/CTModels.jl#408.
🤖 Generated with Claude Code