Skip to content

ENH: Make the default bar width slimmer - #176

Merged
thclark merged 1 commit into
bars-and-histogramsfrom
slender-bar-default
Oct 26, 2026
Merged

thclark merged 1 commit into
bars-and-histogramsfrom
slender-bar-default

Conversation

@thclark

@thclark thclark commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Summary

The default width of a bar becomes 0.55 of the pitch instead of 0.8, which gives a lighter and more elegant default chart. The change applies wherever the default is taken: Default for BarWidth and therefore Default for Bar, the Protocol Buffers decoding of an absent width, and the facade's bar and barh.

The bars helper's default gap between clusters becomes 0.45 instead of 0.2, so that a cluster occupies 0.55 of the pitch and a single series drawn with bars is stored exactly as one drawn with bar. Histograms are unaffected, because hist and hists place touching bars on the widths of their bins with an explicit gap of 0.

Tests

  • The IR, facade, scene and web tests that pinned the old defaults now expect 0.55 of the pitch and a helper gap of 0.45. Tests that set a width or a gap explicitly are unchanged.
  • A new facade test checks that a lone series of bars, upright and lying flat, is stored with the same positions, values, bases, width, offset, margin and style as bar stores the same data.

Documentation

The figure schema reference, the getting-started guide and the rustdoc of BarWidth, Bar, bar, bars, BarMut::width_pitch and BarsMut::gap state the new defaults.

Gallery

Two figures rely on the defaults and change: bar_chart, whose grouped clusters are narrower with wider spaces between them, and every panel of bar_variants. Both read well. No other figure changes.

A bar is now 0.55 of the pitch wide by default rather than 0.8, which
gives a lighter default chart. The default gap between the clusters of
the bars helper becomes 0.45 to match, so that a lone series of the
helper is drawn exactly as bar draws it. Histograms are unchanged,
because they place their bars on the widths of their bins.
@thclark
thclark merged commit 917a641 into bars-and-histograms Oct 26, 2026
7 checks passed
thclark added a commit that referenced this pull request Oct 26, 2026
A bar is now 0.55 of the pitch wide by default rather than 0.8, which
gives a lighter default chart. The default gap between the clusters of
the bars helper becomes 0.45 to match, so that a lone series of the
helper is drawn exactly as bar draws it. Histograms are unchanged,
because they place their bars on the widths of their bins.
@thclark
thclark deleted the slender-bar-default branch October 26, 2026 14:41
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