Title: set_position on Annotation is not working · Issue #2329 · matplotlib/matplotlib · GitHub
Open Graph Title: set_position on Annotation is not working · Issue #2329 · matplotlib/matplotlib
X Title: set_position on Annotation is not working · Issue #2329 · matplotlib/matplotlib
Description: annotation.set_position(...) is not working in versions 1.2.1, 1.3.0 nor on the master. Here is an example that demonstrates this. import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation # Create initi...
Open Graph Description: annotation.set_position(...) is not working in versions 1.2.1, 1.3.0 nor on the master. Here is an example that demonstrates this. import numpy as np import matplotlib.pyplot as plt import matplotl...
X Description: annotation.set_position(...) is not working in versions 1.2.1, 1.3.0 nor on the master. Here is an example that demonstrates this. import numpy as np import matplotlib.pyplot as plt import matplotl...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/2329
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"set_position on Annotation is not working","articleBody":"`annotation.set_position(...)` is not working in versions `1.2.1`, `1.3.0` nor on the `master`.\n\nHere is an example that demonstrates this.\n\n``` python\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\n\n# Create initial data\ndata = np.array([[1,2,3,4,5], [7,4,9,2,3]])\n\n# Create figure and axes\nfig = plt.figure()\nax = plt.axes(xlim=(0, 20), ylim=(0, 20))\n\n# Create initial objects\nline, = ax.plot([], [], 'r-')\nannotation = ax.annotate('A0', xy=(data[0][0], data[1][0]))\nannotation.set_animated(True)\n\ndef init():\n return line, annotation\n\ndef update(num):\n newData = np.array([[1 + num, 2 + num / 2, 3, 4 - num / 4, 5 + num],\n [7, 4, 9 + num / 3, 2, 3]])\n line.set_data(newData)\n # This is not working but in docs it is described as a setter\n # annotation.set_position((newData[0][0], newData[1][0]))\n # This works but this is described in docs as getter\n annotation.xytext = (newData[0][0], newData[1][0])\n return line, annotation\n\nanim = animation.FuncAnimation(fig, update, frames=25, init_func=init,\n interval=200, blit=True)\nplt.show()\n```\n\nSO Question where the bug was discovered: [Animate points with labels with mathplotlib](http://stackoverflow.com/questions/18351932/animate-points-with-labels-with-mathplotlib/18356224)\n","author":{"url":"https://github.com/alefnula","@type":"Person","name":"alefnula"},"datePublished":"2013-08-22T12:38:19.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/2329/matplotlib/issues/2329"}
| 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:97c98265-2b5e-0f2b-b915-b35a31f34718 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D584:25BA60:1384DB1:19F5C7B:6A534A36 |
| html-safe-nonce | 13d3607afe2c0a06ca9f15cbfaeae970602351db244489b03520019e2d944da1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTg0OjI1QkE2MDoxMzg0REIxOjE5RjVDN0I6NkE1MzRBMzYiLCJ2aXNpdG9yX2lkIjoiNjYwMzQ0MDA2MzkzMzI3MDU4MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | db93514fa1b69fb61435d50c8de4483b9a1d4b1030939ce504d3146b230e0cd6 |
| hovercard-subject-tag | issue:18410170 |
| 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/2329/issue_layout |
| twitter:image | https://opengraph.githubassets.com/69f43c0aabffc85ca86ce6116098d91a6269d8bbb376f8327dc4ef9de4383ec3/matplotlib/matplotlib/issues/2329 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/69f43c0aabffc85ca86ce6116098d91a6269d8bbb376f8327dc4ef9de4383ec3/matplotlib/matplotlib/issues/2329 |
| og:image:alt | annotation.set_position(...) is not working in versions 1.2.1, 1.3.0 nor on the master. Here is an example that demonstrates this. import numpy as np import matplotlib.pyplot as plt import matplotl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alefnula |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width