docs: refresh the panel-assembly section for the two layout engines - #106
Open
Starlitnightly wants to merge 1 commit into
Open
docs: refresh the panel-assembly section for the two layout engines#106Starlitnightly wants to merge 1 commit into
Starlitnightly wants to merge 1 commit into
Conversation
Section 8 predated `panel_size=`, `ov.pl.panelflow`, and the helpers that make a plot behave as a panel, and its closing note was by then factually wrong: it told readers `ov.pl.multipanel` "does not express 'panel A is exactly 70 x 70 mm regardless of its neighbours'" and to fall back to `fig.add_axes`. Both engines express exactly that now. Rewritten to cover: - the two engines and when each applies — canvas-fixed vs panel-fixed `multipanel`, and `panelflow` for panels of genuinely different sizes that wrap into rows (`below=` stacking, `units='pt'`, `reserve=`) - making a plot behave as a panel: `roc(aspect='auto')` (a fixed square aspect shrinks the axes inside the rectangle a layout assigned), `boxplot(show_points=False)`, the volcano threshold guides and its ns legend key, and `add_stat_annotation` - text at panel scale: `declutter_ticks` (rotate, stagger, slide apart with leader lines, thin — never resize) and `adjust_text` (clamped inside the axes, which is what makes it safe to call after a layout resized the panel) - a marsilea heatmap as one panel via `rect=`, and why raster-and-imshow is not the alternative - `sankey` and `slopeplot(group=)` Every code cell was executed against the merged library before committing (synthetic AnnData stand-in for pbmc8k): 15 of 15 run clean. Co-Authored-By: Claude Opus 4.8 <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.
Why
Section 8 (
## 8. Assemble the panels) predatedpanel_size=,ov.pl.panelflow, and the helpers that make a plot behave as a panel. Its closing note had become factually wrong — it told readers thatov.pl.multipanelBoth engines express exactly that now (omicverse#930, omicverse#932).
What the section now covers
The two engines, and when each applies
multipanel(width=)multipanel(panel_size=)panelflowplus
panelflow'sbelow=stacking,units='pt', andreserve='tight'/'axis'.Making a plot behave as a panel —
roc(aspect='auto')(a fixed square aspect makes matplotlib shrink the axes inside the rectangle the layout assigned, so the panel stops filling its cell and its x-axis leaves the row baseline),boxplot(show_points=False), the volcano threshold guides and itsns:legend key,add_stat_annotation.Text at panel scale —
declutter_ticks(rotate → stagger → slide apart with leader lines → thin; font sizes never change) andadjust_text(clamped inside the axes, which is what makes it safe to call after a layout resized the panel).A marsilea heatmap as one panel via
rect=, and why rendering it to a raster is not the alternative — it loses the vector text that made the export editable.sankeyandslopeplot(group=)— two panel types a grid of scatter plots cannot express.Verification
Every code cell in the section was executed against the merged library before committing, using a synthetic AnnData stand-in for
pbmc8k: 15 of 15 run clean. (One pre-existing cell needs a realistic gene count forpd.qcutdeciles to be unique — it passes at 2000 genes, and pbmc8k has ~33k.)Companion to omicverse#930 – omicverse#940.