Repository navigation
Respect facet_row_spacing=0 and facet_col_spacing=0 in Plotly Express - #5881
Open
rishi02102017 wants to merge 1 commit into
Open
rishi02102017 wants to merge 1 commit into
rishi02102017 wants to merge 1 commit into
Conversation
init_figure picked the subplot spacing with
`args.get("facet_row_spacing") or 0.07` (and similar for the other
defaults), so an explicit spacing of 0 was treated as unset and the
default gap was used instead. The docstrings allow any float in [0, 1]
and make_subplots accepts 0, so fall back to the default only when the
argument is None. px.imshow builds its facets through the same code
and is fixed too.
rishi02102017
force-pushed
the
px-facet-spacing-zero
branch
from
November 14, 2026 17:30
36814cf to
34a5635
Compare
This branch has not been deployed
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.
Link to issue
Closes #5880
Description of change
Plotly Express fell back to the default facet spacing whenever
facet_row_spacingorfacet_col_spacingwas falsy, so an explicit 0 was ignored. It now uses the default only when the argument isNone. This also fixespx.imshow, which goes through the same code.Testing strategy
Added
test_facets_zero_spacing(rows and columns, with and withoutfacet_col_wrap, plus apx.piecase) andtest_imshow_facet_spacing_zero. They fail on main and pass with this change.Additional information (optional)
Disclosure: this change was prepared with help from an AI assistant (Claude). I've reviewed and tested it, and I'll handle the discussion here myself.
Guidelines