Skip to content

Tighten whitespace around and inside plot figures - #1423

Merged
SimonHeybrock merged 4 commits into
mainfrom
tighter-plot-spacing
Oct 23, 2026
Merged

SimonHeybrock merged 4 commits into
mainfrom
tighter-plot-spacing

Conversation

@SimonHeybrock

@SimonHeybrock SimonHeybrock commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

For users

Plots take up more of each grid cell. There is less blank space around each plot, between axis names and tick labels, around colorbars, and in legends. This matters most in grids with many columns. In a 4×5 grid on a 1920×1080 screen, the median plot area grows by about 55% for images and about 30% for line plots. Legends are about 40% shorter.

Before / after

Plots in a grid with many cells:
images_shown

Legend before (note the last entries in legend are cut off):
Screenshot 2026-10-23 at 08 45 23

Legend after:
Screenshot 2026-10-23 at 08 43 40

Notes for review

The axis, colorbar and legend spacing is set in the Bokeh theme of LivedataDesign rather than in per-figure hooks. A theme also reaches the sub-figures of layout-mode plots, and it costs nothing per update.

Test plan

  • Screenshots of 4×5 image and line grids, a mixed 3×4 grid and the Detectors fixture grid, with toolbars shown and hidden, using the fake backend.
  • Phone layout still looks right.

🤖 Generated with Claude Code

@SimonHeybrock SimonHeybrock self-assigned this Oct 23, 2026
SimonHeybrock and others added 3 commits October 23, 2026 07:15
In grids with many columns, the fixed gaps around each figure take a
visible share of every cell. With the toolbar hidden, two 10 px gaps
sat side by side on the right of each plot: the colorbar padding (or
HoloViews' 10 px border) and Panel's (5, 10) pane margin.

- No pane margin around the plot pane in any layout (compact figures
  already had none; layout-mode figures never got one).
- Figure border 4 px instead of HoloViews' 10, set through the sizing
  opts every plotter applies, so it reaches layout sub-figures too. The
  frame-aspect letterbox uses the same value as its "unpadded" base.
- Bokeh theme on the design: axis label standoff 2 (Material: 10),
  tick label standoff 3 (Bokeh: 5), colorbar padding 4 (Bokeh: 10).
  The compact (phone) hook already used these values; it now only keeps
  the inner toolbar and the smaller axis-name font.

Median plot area in a 4x5 grid at 1920x1080 grows by 57% for images
and 33% for line plots with toolbars hidden, and by 58% and 31% with
toolbars shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Material's theme puts 8 px between legend rows on top of Bokeh's 20 px
glyph height, plus 10 px padding inside the box and 10 px margin to the
frame. Rows go from about 28 px to about 18 px and a two-entry legend
from about 65 px to about 37 px tall, which matters in small grid cells
where the legend covers the data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bokeh grows a figure's top border just enough to hold a y tick label
centred on the frame's top edge, so with no pane margin that label
touched the titlebar. A larger figure border would not help: the
label's overhang (about 10 px) already exceeds it. A 4 px top margin on
the plot pane restores the gap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@SimonHeybrock SimonHeybrock left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

LGTM

@SimonHeybrock
SimonHeybrock merged commit 1dcfb8e into main Oct 23, 2026
20 checks passed
@SimonHeybrock
SimonHeybrock deleted the tighter-plot-spacing branch October 23, 2026 08:19
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