Repository navigation
Keep add_hline/add_vline on empty subplots when the target is explici… - #5873
Open
mutasim-rehman wants to merge 1 commit into
Open
mutasim-rehman wants to merge 1 commit into
mutasim-rehman wants to merge 1 commit into
Conversation
plotly#5136) Skip exclude_empty_subplots for add_hline/add_vline when the grid has a single subplot or both row and col are given. Default exclusion for unspecified cells in multi-subplot grids and hrect/vrect behavior are unchanged. Co-authored-by: Mutasim ur Rehman <motasimurrehman565@gmail.com>
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.
Fix line options being discarded on empty subplots when the intent is explicit.
Skip
exclude_empty_subplotsforadd_hline/add_vlinewhen the grid has a single subplot or bothrowandcolare given. Default exclusion for unspecified cells in multi-subplot grids andhrect/vrectbehavior are unchanged.Link to issue
Closes #5136.
Description of change
Preserve axis-spanning lines added before traces when a figure has one subplot or the user explicitly selects a subplot with both
rowandcol. The existing empty-subplot exclusion remains unchanged for unspecified or partially targeted multi-subplot grids, andadd_hrect/add_vrectare unaffected.Demo
No visual demo included. Regression tests verify the resulting line shapes and axis references; the four preservation cases fail before this change and pass afterward.
Testing strategy
Added regression tests covering single-subplot grids, explicitly selected cells, default exclusions, and unchanged rectangle behavior. The focused update-annotations and autoshapes tests pass: 59 passed.
Additional information (optional)
This implements the behavior suggested by the maintainer in #5136. Only the focused test files were run locally; full CI remains to validate the change.
Guidelines