Skip to content

recording: colormaps_and_style (colormaps, guided tour)#19

Merged
borisbat merged 1 commit into
masterfrom
bbatkin/colormaps-and-style-recording
Jun 7, 2026
Merged

recording: colormaps_and_style (colormaps, guided tour)#19
borisbat merged 1 commit into
masterfrom
bbatkin/colormaps-and-style-recording

Conversation

@borisbat

@borisbat borisbat commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Last of the four display-tour recordings, and the final tutorial in the series. colormaps_and_style covers the two ways a colormap shows up:

  • HEAT (left) — a fixed-Viridis heatmap with its colormap_scale colorbar. 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 from heatmap_histogram).
  • LINES (right) — six series auto-colored from one Spectral with_colormap scope; each plot_line takes 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. A bust_color_cache daslib 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

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_style that 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``.
@borisbat borisbat merged commit 109bf3d into master Jun 7, 2026
7 of 8 checks passed
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.

2 participants