Skip to content

fix: grid labels hidden on false overlap at rotation=90#2668

Merged
rcomer merged 1 commit intoSciTools:mainfrom
guillermodotn:fix/label-overlap
May 8, 2026
Merged

fix: grid labels hidden on false overlap at rotation=90#2668
rcomer merged 1 commit intoSciTools:mainfrom
guillermodotn:fix/label-overlap

Conversation

@guillermodotn
Copy link
Copy Markdown
Contributor

Rationale

Gridline labels hidden at rotation=90° due to intersects_path() false positives on collinear edges.

Fixes #2394.

Implications

Adds a bbox pre-check before intersects_path(); if bboxes don't overlap, skip the path check. Tilted geo labels unaffected.

@rcomer
Copy link
Copy Markdown
Member

rcomer commented Apr 21, 2026

Thanks for this @guillermodotn. My only worry is that calling get_extents here will slow down what is already a pretty slow draw. Since we call check_overlapping on every pair of visible labels, the time increases with order N**2. Could we instead call get_extents once for each label and attach the extents to the label alongside the path here? I tried locally by timing this particularly slow test and it does seem to make a difference (unless I made a mistake...)

@rcomer
Copy link
Copy Markdown
Member

rcomer commented Apr 21, 2026

Also you have a typo in your commit/title: 9 -> 90

@guillermodotn guillermodotn changed the title fix: grid labels hidden on false overlap at rotation=9 fix: grid labels hidden on false overlap at rotation=90 Apr 23, 2026
@guillermodotn
Copy link
Copy Markdown
Contributor Author

Thanks for pointing to where to cache it and the benchmark test.

Fixed both.

Copy link
Copy Markdown
Member

@rcomer rcomer left a comment

Choose a reason for hiding this comment

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

Sorry, this fell off my to-do list.

Thanks for your work on this @guillermodotn!

@rcomer rcomer merged commit d9711f5 into SciTools:main May 8, 2026
23 checks passed
@QuLogic QuLogic added this to the Next Release milestone May 8, 2026
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.

Missing y-axis gridline labels when rotated to 90 degrees

3 participants