feat(plotting): contour and heatmap plots (imshow, contour, tripcolor, tricontour, colorbar) - #12
Merged
Merged
Conversation
Pure formatting (mostly quote normalization) with no functional changes, separated out so the feature diff stays reviewable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…g and colorbars Add matplotlib-style 2-D plotting backed by GLE's native surface tooling: - imshow(Z): gridded heatmaps via the GLE colormap command and generated .z sidecar files; extent/origin/vmin/vmax/interpolation supported; renders correctly on log axes - contour(x, y, Z): contour lines via begin-contour blocks with explicit or automatic levels and optional inline value labels (clabel) - tripcolor/tricontour(x, y, z): scattered-data variants (e.g. magnetic susceptibility measurements) gridded at GLE compile time by begin-fitz Akima interpolation - no scipy dependency - Figure.colorbar(): self-contained colorbar subroutine with automatic right-margin reservation so single-axes figures no longer clip it - eight palettes (viridis default, magma, inferno, plasma, cividis, coolwarm, gray, rainbow) emitted as self-contained GLE subroutines transcribed from gle-library sources; values clamped to [0,1] so fitz overshoot saturates instead of speckling - mathtext_to_gle(): matplotlib $...$ math in labels is translated to GLE's TeX-like markup at store time (Greek letters, sub/superscripts) - full parser/recognizer round-trip: emitted GLE re-parses into the object model with byte-identical writer-recognizer-writer fixed point; foreign hand-written colormap/fitz/contour GLE is preserved verbatim - full GUI authoring: heatmap/contour series panels (palette, z-range, levels editor, colorbar controls) and scattered x/y/z creation flow in the data manager - guide (docs/guides/CONTOUR_AND_HEATMAPS.md) with an antiferromagnet field-temperature phase diagram worked example, plus runnable examples Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
GLE 4.3.9 built on the macOS ARM CI runners aborts with no error output while rendering scripts containing begin-fitz/begin-contour blocks; the identically pinned Linux build compiles them fine and upstream GLE has no functional changes between v4.3.9 and master, so this is a platform crash in GLE's Akima/contour code rather than a gleplot emission bug. Marks the scattered-data compile test xfail (non-strict) on darwin and adds a tripcolor-only sibling with the same marker so the macOS job's XFAIL/XPASS report shows which GLE stage (fitz vs contour) crashes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CI experiment result: fitz-only compilation XPASSes on both macOS jobs while the begin-contour script XFAILs, so the platform crash is in GLE's contour stage, not fitz. The tripcolor-only test now runs as a hard assertion everywhere; only the contour-bearing test stays xfail on darwin. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Adds matplotlib-style 2-D contour/heatmap plotting backed by GLE's native surface tooling, motivated by magnetic field–temperature phase diagrams from susceptibility data:
imshow(Z)— gridded heatmaps via GLE'scolormapcommand + generated.zsidecars (extent/origin/vmin/vmax/interpolation; correct on log axes).origin="lower"is the default (deviates from matplotlib — documented).contour(x, y, Z)— contour lines viabegin contourblocks, explicit/automatic levels, optional inline value labels (clabel).tripcolor/tricontour(x, y, z)— scattered measurement data gridded at GLE compile time viabegin fitz(Akima) — no scipy dependency.Figure.colorbar()— self-contained colorbar subroutine; figure layout reserves right margin so nothing clips.$\chi$-style matplotlib math in any label is translated to GLE's TeX-like markup at store time (gleplot.mathtext_to_gleis public API).docs/guides/CONTOUR_AND_HEATMAPS.mdwith an antiferromagnet H–T phase-diagram worked example;examples/basic/heatmap_imshow.py,examples/advanced/phase_diagram.py.The first commit is pure black formatting of touched modules (quote normalization), split out so the feature diff stays reviewable.
Known limitations
colormapslot limit) — guarded with a clear error.tricontourlevel ranges can't be validated at store time (grid exists only at GLE compile time).begin contourblocks — isolated by CI experiment (fitz-only scripts pass; Linux passes with the identically pinned build; upstream has no functional changes since v4.3.9). The contour-bearing compile test is non-strict xfail on darwin; this is an upstream GLE platform issue, not an emission bug.Test plan
🤖 Generated with Claude Code