matplotlib / matplotlib/matplotlib

[ENH]: expand connectionPatch coords to support all annotation coords

Open
#26,440 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

New feature topic: arrow
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.