Title: [ENH]: Position artists (particularly Annotations) relative to multiple other artists · Issue #22223 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: Position artists (particularly Annotations) relative to multiple other artists · Issue #22223 · matplotlib/matplotlib
X Title: [ENH]: Position artists (particularly Annotations) relative to multiple other artists · Issue #22223 · matplotlib/matplotlib
Description: Problem Currently we can position text relative to a single artist, as described in https://matplotlib.org/stable/tutorials/text/annotations.html?highlight=complex coordinate#using-complex-coordinates-with-annotations. I would like to ...
Open Graph Description: Problem Currently we can position text relative to a single artist, as described in https://matplotlib.org/stable/tutorials/text/annotations.html?highlight=complex coordinate#using-complex-coordi...
X Description: Problem Currently we can position text relative to a single artist, as described in https://matplotlib.org/stable/tutorials/text/annotations.html?highlight=complex coordinate#using-complex-coordi...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/22223
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: Position artists (particularly Annotations) relative to multiple other artists","articleBody":"### Problem\r\n\r\nCurrently we can position text relative to a single artist, as described in https://matplotlib.org/stable/tutorials/text/annotations.html?highlight=complex%20coordinate#using-complex-coordinates-with-annotations.\r\n\r\nI would like to position texts relative to *multiple* artists. For instance, let's consider two text artists, `txt1` positioned at (0.5,0.25) and `txt2` (.5,0.75). Assume they are left-aligned and of width 0.1, so the left edge of each of their bbox is at 0.5, the right edge is at 0.6, and assume that `txt2` at (.5,0.75) is top-aligned, so the top of its bbox is 0.75, and `txt1` is bottom-aligned, so the bottom of its bbox is 0.25. \r\n\r\nI would like some function `combine_artists(txt1,txt2)` that returns an object that combines the coordinate systems of `txt1` and `txt2` so that an artist can be positioned relative to the *combined bbox*. For instance, I would like to position some artist `txt3` that is vertically centered between `txt1` and `txt2`. Its data coordinate is (0.5,0.5), but its relative position coordinate in the combined `txt1+txt2` space would be (0,0.5).\r\n\r\n### Proposed solution\r\n\r\nThere may already be a way to do this in the library, as it seems transforms are addable. What remains then is making the interface to creating the combined bbox/transform in a way that is easily accessible. I already tried just adding the transforms of the `txt1` and `txt2`, which seemed like the most intuitive way for this to work.","author":{"url":"https://github.com/stanleyjs","@type":"Person","name":"stanleyjs"},"datePublished":"2022-01-12T23:29:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/22223/matplotlib/issues/22223"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f0a61d88-545c-ad35-5e7b-81a81fa8b558 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B86E:1B1CFD:4A368:65C7B:6A525F63 |
| html-safe-nonce | 2ac0dd3bc679630d455eabe9474bee14031437d5d76fe82050fab78a268e5794 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODZFOjFCMUNGRDo0QTM2ODo2NUM3Qjo2QTUyNUY2MyIsInZpc2l0b3JfaWQiOiI3MzAxMzI1ODU1Mjk2NDc5MDc2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 34290a33a579cda83e523167543a09f8019b2724fa74f9ffeabc5df735bdcb7a |
| hovercard-subject-tag | issue:1100915756 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/22223/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0f60f74920fabd9e458530d605b248be532653f9cd6ee711fa118876ca6b9019/matplotlib/matplotlib/issues/22223 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0f60f74920fabd9e458530d605b248be532653f9cd6ee711fa118876ca6b9019/matplotlib/matplotlib/issues/22223 |
| og:image:alt | Problem Currently we can position text relative to a single artist, as described in https://matplotlib.org/stable/tutorials/text/annotations.html?highlight=complex coordinate#using-complex-coordi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | stanleyjs |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width