recording: colormaps_and_style (colormaps, guided tour)#19
Merged
Conversation
Last of the four display-tour recordings, and the last in the tutorial series. colormaps_and_style covers the two ways a colormap shows up: a fixed-Viridis HEAT plot with its colorbar, and six series auto-colored from a Spectral colormap (each plot_line takes the next color, no per-series color set). A live colormap-picker combo was attempted but dropped: ImPlot caches an item's color by id on first draw, so with_colormap only colors items created inside its scope for the first time - changing the map live does not recolor a steady set of auto-colored series. So this is a guided tour: the cursor drifts to the colorbar (Viridis reads as a smooth ramp from low to high - the sequential-map case forward-referenced from heatmap_histogram), then glides to the auto-colored series. REAL synthetic input and self-verifying: both plots must render at every beat, so a dead frame or wrong window aborts at teardown. The rst documents the color-cache behavior + the BustColorCache / sample_colormap remedies, so the dropped-combo finding lands as a real doc note. - tests/integration/record_colormaps_and_style.das: the voiced driver (intro both plots + trace the colorbar + point at the auto-colored series). - doc/source/tutorials/colormaps_and_style.rst: + .. video:: colormaps_and_style.mp4, a Walkthrough section, and a note on ImPlot's per-item color cache. - doc/source/_static/tutorials/colormaps_and_style.mp4: the recording (913 KB, 33.8s, 908 frames, 0 dropped, Emma voice + -16 dB bed). The headless guard is the existing test_colormaps.das. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds the final guided-tour tutorial/recording in the display-tour series, focusing on how ImPlot colormaps appear in both heatmaps (with a colorbar) and auto-colored line series, and documents the “live colormap switch doesn’t recolor cached items” behavior.
Changes:
- Adds an integration recording driver for
colormaps_and_stylethat narrates and gestures over the heatmap/colorbar and auto-colored line series. - Adds a “Walkthrough” section to the tutorial docs, embedding the video and documenting ImPlot’s item color-cache behavior and remedies.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
tests/integration/record_colormaps_and_style.das |
New recording driver that opens both plots, drives cursor motion, and asserts rendered state during the tour. |
doc/source/tutorials/colormaps_and_style.rst |
Adds walkthrough video embed plus a note explaining why live colormap swaps don’t recolor existing auto-colored items and how to address it. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+63
to
+66
| move_to(app, (hx + hw * 0.96f, hy + hh * 0.5f), 900) | ||
| wait_for_mouse_idle(app) | ||
| record_check_rendered(app, HEAT, true) | ||
| hold_remainder(d_heat, t_heat) |
Comment on lines
+73
to
+76
| move_to(app, plot_center(lsnap, lines), 900) | ||
| wait_for_mouse_idle(app) | ||
| record_check_rendered(app, LINES, true) | ||
| hold_remainder(d_lines, t_lines) |
Comment on lines
+46
to
+50
| caches each item's color by id on first draw, so ``with_colormap`` only colors items | ||
| created inside its scope for the first time. To recolor a steady set of items after a | ||
| colormap switch, call ImPlot's ``BustColorCache(plot_title)`` (clears the cache so the | ||
| items re-pull) or set each item's color explicitly from ``sample_colormap`` / | ||
| ``GetColormapColor``. |
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.
Last of the four display-tour recordings, and the final tutorial in the series.
colormaps_and_stylecovers the two ways a colormap shows up:colormap_scalecolorbar. Viridis is sequential, so the bar reads as a smooth ramp low→high (the natural fit for a heatmap, and the sequential-ramp case forward-referenced fromheatmap_histogram).with_colormapscope; eachplot_linetakes the next color, no per-series color set.This is a guided tour — the cursor drifts to the colorbar, then glides to the auto-colored series. REAL synthetic input and self-verifying: both plots must render at every beat, so a dead frame or wrong window aborts at teardown.
On the dropped live colormap-picker
I first added a combo that recolors the series live, but ImPlot caches each item's color by id on first draw, so
with_colormap(newmap)doesn't recolor a steady set of auto-colored items — the combo committed but the lines stayed Spectral. Rather than ship a misleading demo, the interaction was dropped (the example + test are unchanged from master). The rst now carries a.. note::documenting the cache behavior and the sanctioned remedies (BustColorCache(title)/sample_colormap/GetColormapColor), so the finding lands as a real doc note. Abust_color_cachedaslib rail is the follow-up if a live colormap demo is ever wanted.Files
tests/integration/record_colormaps_and_style.das— the voiced driver (intro both plots + trace the colorbar + point at the auto-colored series).doc/source/tutorials/colormaps_and_style.rst—+ .. video:: colormaps_and_style.mp4, a Walkthrough section, and the color-cache note.doc/source/_static/tutorials/colormaps_and_style.mp4— the recording (913 KB, 33.8s, 908 frames, 0 dropped, Emma voice + −16 dB bed).The headless guard is the existing
test_colormaps.das.🤖 Generated with Claude Code