Cycle only over filled markers for default artist style - #591
Open
SimonHeybrock wants to merge 1 commit into
Open
Cycle only over filled markers for default artist style#591SimonHeybrock wants to merge 1 commit into
SimonHeybrock wants to merge 1 commit into
Conversation
`Line2D.markers` is the full marker registry, not a list of usable plot markers: it contains the integer tick and caret markers, as well as markers that draw nothing. Plotting 24 or more lines thus picked an integer marker, raising `AttributeError: 'int' object has no attribute 'lower'`, and 35 or more lines would have silently produced invisible artists. Fixes #590 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
SimonHeybrock
marked this pull request as draft
July 28, 2026 08:59
SimonHeybrock
marked this pull request as ready for review
July 28, 2026 09:01
nvaytet
approved these changes
Jul 30, 2026
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.
Fixes #590.
Plotting 24 or more lines (e.g. from
sc.collapse) raisedAttributeError: 'int' object has no attribute 'lower'. The default marker was cycled overLine2D.markers, which is the full marker registry rather than a list of usable plot markers: it contains the integer tick and caret markers, and four entries that draw nothing. Beyond 34 artists the markers would have been invisible rather than raising.Cycling over
Line2D.filled_markersinstead. The shared helper lives in the matplotlib backend utils, since lines and scatter points used the same expression.On the
+ 2offset that was there before: it dates back to the initial import and was never touched since, so there is no recorded intent. What it does is skip'.'and',', the first two entries ofLine2D.markers, so that the cycle starts at'o'. The new+ 1offset intofilled_markerspreserves that, and artists 0-4 get the same markers as before. From artist 5 onwards the unfilled markers ('1' '2' '3' '4' '+' 'x' '|' '_') are now skipped; those are the ones that make matplotlib warn when the mask overlay sets an edgecolor, so masks on such lines could not be highlighted as intended. The cycle is 16 long instead of 41, so markers repeat sooner, but colors already repeat every 10.Test plan
mainand pass here.