position_dodge2() leaves nested rectangles overlapping
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- python
- Domain
- data-visualization
Research direction
Read find_x_overlaps() in plotnine/positions/position_dodge2.py at the linked lines. Check how it groups intervals when a short rectangle lies between wider overlapping intervals, then run the relevant position dodge tests. Done means the three rectangles no longer overlap after dodging and existing overlap cases still pass.
Written by the indexing model from the issue text.
Description
I plotted three rectangles with x-ranges [0, 10], [5.1, 5.5], and [5.6, 6.0] using geom_rect(position=position_dodge2(padding=0)). All three had the same y-range. After drawing, plotnine placed the wide rectangle at [2.4, 7.4] and left the third rectangle at [5.6, 6.0], entirely inside it. Overlapping rectangles can hide a data series in the resulting chart.
find_x_overlaps() compares each rectangle’s left edge only with the previous rectangle’s right edge. A short rectangle can therefore break the group even when a wider rectangle still spans it. The fix is to group intervals by left edge while tracking the furthest right edge in the current group. Overlap detection
- Dominant language
- Python
- Stars
- 4.8k
- Forks
- 269
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from has2k1/plotnine
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Feature request: add rotation_mode param to geom_textPossibly taken A pull request linked to this issue is open or already merged. OpenFeature
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Enhancement
Difficulty 3/5 Half a day Newbie friendliness 55/100
-
Enhancement
Difficulty 4/5 3-5 days Newbie friendliness 52/100
-
Discussion
Difficulty 5/5 Over a week Newbie friendliness 30/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
bad-antics/lateralus-lang#1623 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
fossguild/thelifesnake#82 ·
Maintainers usually reply within 1 day
-
Unfitted DialectClassifier crashes with a confusing ValueError: raise a clear "not fitted" errorOpengood first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
omarelshamy25x/shamy-arabic-nlp#111 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pietbarber/Manage2Soar#1189 ·
Maintainers usually reply within 1 day
-
BUG: write_netcdf fails on Tutorial 3 BEM output with pandas CategoricalDtype DOF coordinatesPossibly taken @dtgaebe claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
sandialabs/WecOptTool#467 ·