Skip to content

Batch multiblock figure: carry the batch colours into the parity panel - #94

Merged
kgdunn merged 3 commits into
mainfrom
claude/issues-154-156-process-3cu4iq
Sep 9, 2026
Merged

kgdunn merged 3 commits into
mainfrom
claude/issues-154-156-process-3cu4iq

Conversation

@kgdunn

@kgdunn kgdunn commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Follows #93, from review of the FMC page.

The super-score panel of batch-case-fmc-batch-mbpls.png marks batches 13 (orange), 5 and 7 (aqua), and the chapter reads all three together: batch 13 at the low end of the first component, batches 5 and 7 on the other side among the batches classed abnormal although both were classed good.

The observed-against-fitted panel beside it marked only batch 13. Batches 5 and 7 were indistinguishable from the other 43 points, so the reader could see where those two sit in the score plot but not how the model actually fits them.

A second commit takes it further, after review: the whole panel used a different visual language from the score plot beside it, drawing all 46 batches as plain dark-blue dots where the score plot codes them by the plant's classification, and even the highlighted batches lost their class marker.

parity_plot now accepts the same groups and group_styles the score plots take, and delegates its scatter to group_scatter, so colour, marker shape and size come from one place. The class legend is suppressed on the parity panel, since the score plot beside it already names the three classes.

What the coding shows

With the classes drawn, something the plain dots hid becomes visible: all seven batches classed high in residual solvent sit at the top of the observed range and every one is fitted below the line, by 0.58 on average where the attribute spans 1.41. The other two classes scatter evenly about the line, at +0.03 and +0.10.

That is shrinkage, not a defect: two components describing under half of the quality block pull the extremes back towards the middle. The book page gains a sentence saying so, with the count and both figures printed in the code block and echoed in a comment so the checker compares them.

Verification

  • Regenerated the FMC and SBR sets; only batch-case-fmc-batch-mbpls.png and batch-case-sbr-observed-vs-fitted.png differ.
  • Viewed both figures: the FMC parity panel now reads as the score plot does, and the SBR parity panels are unchanged apart from the shared marker size (28 rather than a local 26) and edge width, since they pass no groups.
  • check_labels.py reports no label running off a figure, intruding into a marker, landing on another label or sitting under a legend.
  • On the book side, make check-code-file on the FMC page runs the chapter up to it: 71 blocks, all passed with --strict-output. make text is clean. The caption, alt text and new sentence are in the matching pid-book commits on #273.

One thing left for the author to decide

Orange carries two meanings inside this one figure: batch 13 in the left panel, and the super VIP bar series in the middle panel. That is the same kind of collision the DuPont page was corrected for in #92, where one meaning per colour was applied across the page. It is arguably milder here, since the two panels encode different kinds of entity (batches against measures) and each has its own legend.

Not changed, because it restyles a panel that was not under review. If it should be fixed, the middle panel's second bar colour is the thing to change, and MAGENTA is unused on this page.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LXthGpHLQFfGubBiKFtGAE


Generated by Claude Code


Generated by Claude Code

… figure

The super-score panel marks batches 13 (orange), 5 and 7 (aqua), and the
prose reads all three together. The parity panel beside it marked only
batch 13, so batches 5 and 7 were indistinguishable from the other 43
points and the reader could not see how the two batches that sit among the
abnormal group are actually fitted.

parity_plot already takes a highlight dict, so the three now carry the same
colours in both panels.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LXthGpHLQFfGubBiKFtGAE
The parity panel drew every batch as a plain dark-blue dot, so a panel
sitting beside a score plot coded by the plant's classification used a
different visual language for the same 46 batches. Only the highlighted
batches shared a colour, and even those lost their class marker.

parity_plot now takes the same groups and group_styles the score plots
take, and delegates its scatter to group_scatter, so colour, marker shape
and size come from one place. The class legend is suppressed on the parity
panel, since the score plot beside it already names the three classes.

In the batch multiblock figure the right panel now reads as the left one
does, and the coding shows something the plain dots hid: the batches
classed high in residual solvent all sit at the high-observed end and are
fitted below the line.

The SBR parity panels pass no groups, so they keep plain dots and are
unchanged apart from the shared marker size (28 rather than a local 26)
and edge width. Their labels, error entries and bands are as before, and
check_labels.py reports no collisions anywhere.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LXthGpHLQFfGubBiKFtGAE
…cross

Two figure changes from review.

The block-score panels asserted that four batches classed good sit among
the abnormal ones in the trajectory block, and left the reader to see it.
Each batch is now joined by a faint line to the average point of the group
it is placed with, and a cross marks the two averages, so the rule behind
the reading is on the figure: in the trajectory block the four reach across
to the abnormal group, and in both initial-condition blocks they reach to
the good one.

The SBR influence plot drew every batch at the same size, beside a score
plot whose marker areas carry the squared SPE. A reader could not match a
batch between the pair. influence_plot now takes the same sizes argument
and scales the areas the same way, so the two faulty batches are the
smallest markers on both figures and batch 8 the largest.

check_labels.py reports no collisions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LXthGpHLQFfGubBiKFtGAE
@kgdunn
kgdunn merged commit b30b261 into main Sep 9, 2026
3 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