Skip to content

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

Open
guillermodotn wants to merge 1 commit intoSciTools:mainfrom
guillermodotn:fix/label-overlap
Open

fix: grid labels hidden on false overlap at rotation=90#2668
guillermodotn wants to merge 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.

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

2 participants