matplotlib / matplotlib/matplotlib
[ENH]: expand connectionPatch coords to support all annotation coords
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 23.2k
- Forks
- 8.5k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 66
Description
### Problem
ConnectionPatch is described as annotation w/o text in the tutorial and as a function for connecting two aribtrary points in its docs and it would be very helpful if those two points could be artists. Since annotation supports this, I'm doing a lot of
```python
arrow = ax.annotate("", (x1, y1), (x2, y2), xycoords=A1, textcoords=A2, arrowprops=dict(arrowstyle='-|>'))
label = ax.annotate("label", (xp, yp), xycoords=arrow)
```
and I'd really rather prefer to use the object with "connect thing" semantics for connecting things and the object with "label things" semantics for labeling.
### Proposed solution
@anntzer proposed factoring out the annotation coordinate system in https://github.com/matplotlib/matplotlib/issues/22223#issuecomment-1011957191 and that's the approach I'd advocate here -> pull out the coordinate logic into its own logic and then have ConnectionPatch call out to that function.
Contributor guide
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.
Research direction
Start by reading ConnectionPatch and the annotation coordinate handling, then review the coordinate-system factoring approach proposed in issue #22223. The work is done when ConnectionPatch supports the annotation coordinate forms described here, including artist coordinates, while preserving its connecting semantics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100