Repository navigation
Tighten whitespace around and inside plot figures - #1423
Merged
Merged
Conversation
SimonHeybrock
force-pushed
the
tighter-plot-spacing
branch
from
October 23, 2026 07:01
b0bee98 to
272f5b1
Compare
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
force-pushed
the
tighter-plot-spacing
branch
from
October 23, 2026 07:15
272f5b1 to
4919d84
Compare
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.
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:

Legend before (note the last entries in legend are cut off):

Legend after:

Notes for review
The axis, colorbar and legend spacing is set in the Bokeh theme of
LivedataDesignrather than in per-figure hooks. A theme also reaches the sub-figures of layout-mode plots, and it costs nothing per update.Test plan
🤖 Generated with Claude Code