Skip to content

Use the Titanic dataset for every README example - #76

Merged
gyli merged 2 commits into
masterfrom
docs/readme-one-dataset
Sep 17, 2026
Merged

gyli merged 2 commits into
masterfrom
docs/readme-one-dataset

Conversation

@gyli

@gyli gyli commented Sep 17, 2026

Copy link
Copy Markdown
Owner

#68 rewrote the quickstart around the people aboard the Titanic, but left the six numbered examples below it on their original data: Cat1/Cat2/Cat3, invented vehicle sales figures, and Factory A/B/C. The page introduced a real dataset and then dropped it, so a reader following along had to reorient five times.

I checked whether the Titanic figures could carry all six before assuming they could. They can.

README example what it needs Titanic cut used
1. Value scaling values that must be scaled to fit the grid class and crew counts, 2,201 onto a 5x10 grid
2. Values in dict & auto-sizing values small enough to be block counts the 109 children aboard: 6, 24, 79
3. Colours, title, direction, arranging 3 to 5 categories worth styling who was aboard, by class
4. Pictogram categories with genuinely distinct icons men, women and children
5. Existing axis anything small survived and lost, 710 and 1,491
6. Multiple plots from a DataFrame a real two-dimensional table class by group

Two were the awkward ones:

Auto-sizing needs absolute block numbers, and 2,201 is far too many. The children aboard total 109, so rows=5 gives a 22-column chart where one block really is one child, which is a better illustration of the feature than the placeholder numbers were.

The DataFrame example needs a genuine table rather than a list. The inquiry's own table is already class by group, so first/second/third class against men/women/children drops straight in. Sizing each subplot by its own class turns out to carry the point on its own: third class is visibly wider than first and second together.

On accuracy

The prose quotes the real scaled numbers. The old text said "automatically scaled to 24, 23 and 3"; the new text says 7, 6, 16 and 20, which I read off the rendered chart rather than computing by hand. I also confirmed the per-class men/women/children rows sum to the class totals used elsewhere on the page (325, 285, 706), so the two cuts of the dataset agree with each other.

The source is cited once at the end of the section rather than repeated under every chart.

Verified

  • All 6 documentation tests pass, 69 subtests (up from 63), which is every fenced Python block in the README and docs executed as written.
  • Full suite green, 234 tests.
  • Every referenced image exists (the check CI runs).
  • Spot-checked that the values in the README snippets are character-for-character the values in examples/generate_plots.py, so the code shown is the code that produced the image above it.
  • Regenerating twice produces no further diff.
  • Sphinx builds with zero warnings.

Not included

demo.ipynb still uses the old data. It is a separate artifact with its own outputs committed, and rebuilding it is a much larger diff, so it is better as its own change.


Update: example 3 reordered

The styling example used block_arranging_style='snake', and with four categories on a 5x10 grid that reads badly. Snake reverses every other row, so Second class came out as two disconnected patches — top right, then the right of row two — with Third class running underneath on the left. Scanning left to right you met gold, teal, terracotta, then teal again, which looks like the data is out of order rather than a deliberate layout.

Measured rather than judged by eye. Reading the grid top-left to bottom-right and counting colour runs, where four categories ideally give four runs:

arrangement colour runs
NW, vertical=True, snake (before) 7
NW, vertical=True (after) 4, plus the trailing empty cell
NW, vertical=False, snake 19
NW, vertical=False, normal 21

Each category is now a single continuous run and the chart reads in legend order, the way a line of text does.

starting_location="NW" and vertical=True stay, so the example still shows a layout that differs from the default — verified the first block moves from bottom-left to top-left. block_arranging_style keeps its own paragraph and its documentation link, so it stays discoverable without having to make this particular chart confusing to earn its place. The section heading no longer promises "Arranging Style".

PR #68 rewrote the quickstart around the people aboard the Titanic but left the six
numbered examples below it on their original data: Cat1/Cat2/Cat3, invented vehicle sales
numbers, and Factory A/B/C. So the page introduced a real dataset and then dropped it,
and a reader following along had to reorient five times.

The Titanic figures turned out to cover every example, including the two with awkward
requirements:

- Auto-sizing needs values small enough to be block counts. The children aboard, 6, 24
  and 79, total 109, so one block really is one child.
- The DataFrame example needs a genuine two-dimensional table. The inquiry table is
  already class by group, so first/second/third class against men/women/children drops
  straight in, and sizing each subplot by its own class shows that third class carried
  more people than first and second combined.

The prose now quotes the real scaled numbers, 7, 6, 16 and 20 for the value-scaling
example, taken from the rendered chart rather than computed by hand.

Source, added once at the end of the section: the British Board of Trade inquiry of 1912.
With four categories on a 5 x 10 grid, snake reversed every other row, so Second class
came out as two disconnected patches, top right and then the right of row two, with Third
class running underneath on the left. Reading left to right you met gold, teal,
terracotta, then teal again, which looks like the data is out of order rather than like a
deliberate layout.

Measured it rather than judging by eye: reading the grid top left to bottom right, the
snake version broke the four categories into seven colour runs. Without it, each category
is a single run and the chart reads in legend order, the way a line of text does.

starting_location="NW" and vertical=True stay, so the example still shows a layout that
differs from the default. block_arranging_style keeps its paragraph and its link, since
it is worth knowing about; it just no longer has to make this particular chart confusing
to earn its place.
@gyli
gyli merged commit b3e0d5b into master Sep 17, 2026
13 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.

1 participant