Title: pyplot.annotate() API deprecation · Issue #15142 · matplotlib/matplotlib · GitHub
Open Graph Title: pyplot.annotate() API deprecation · Issue #15142 · matplotlib/matplotlib
X Title: pyplot.annotate() API deprecation · Issue #15142 · matplotlib/matplotlib
Description: Bug report Bug summary I wanted to update my code that annotates a plot by changed the deprecated keyword argument s to text as described in the documentation of matplotlib v3.1.1. However it fails to recognise text as an argument and re...
Open Graph Description: Bug report Bug summary I wanted to update my code that annotates a plot by changed the deprecated keyword argument s to text as described in the documentation of matplotlib v3.1.1. However it fails...
X Description: Bug report Bug summary I wanted to update my code that annotates a plot by changed the deprecated keyword argument s to text as described in the documentation of matplotlib v3.1.1. However it fails...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/15142
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"pyplot.annotate() API deprecation","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\n\r\nI wanted to update my code that annotates a plot by changed the deprecated keyword argument `s` to `text` as described in the documentation of matplotlib v3.1.1. However it fails to recognise `text` as an argument and requests `s` instead.\r\n\r\n**Code for reproduction**\r\n\r\n\u003c!--A minimum code snippet required to reproduce the bug.\r\nPlease make sure to minimize the number of dependencies required, and provide\r\nany necessary plotted data.\r\nAvoid using threads, as Matplotlib is (explicitly) not thread-safe.--\u003e\r\n\r\n```python\r\nimport matplotlib\r\nimport matplotlib.pyplot as plt\r\n\r\n\r\nprint(matplotlib.__version__)\r\nprint(matplotlib.get_backend())\r\nmatplotlib.pyplot.plot()\r\nmatplotlib.pyplot.annotate('without keyword', xy=(0.5, 0.75))\r\nmatplotlib.pyplot.annotate(s='keyword \"s\"', xy=(0.5, 0.5))\r\nmatplotlib.pyplot.annotate(text='keyword \"test\"', xy=(0.5, 0.25))\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\u003c!--The output produced by the above code, which may be a screenshot, console output, etc.--\u003e\r\n\r\n\r\n```\r\n3.1.1\r\nTkAgg\r\nTraceback (most recent call last):\r\n File \"\u003cinput\u003e\", line 9, in \u003cmodule\u003e\r\nTypeError: annotate() missing 1 required positional argument: 's'\r\n```\r\n\r\n**Expected outcome**\r\n\r\nI would expect that the keyword we should use in version 3.1.1 would be 'text' since in the documentation (https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.pyplot.annotate.html) it says:\r\n\r\n\r\nParameters: | text : str *The text of the annotation. s is a deprecated synonym for this parameter.*\r\n-- | --\r\n\r\n\r\n\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating system: Windows\r\n * Matplotlib version: 3.1.1\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): TkAgg\r\n * Python version: 3.7.4\r\n\r\nI installed matplotlib through pip\r\n\r\n","author":{"url":"https://github.com/amaeckelberghe","@type":"Person","name":"amaeckelberghe"},"datePublished":"2019-08-27T10:01:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/15142/matplotlib/issues/15142"}
| 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:650980b5-7365-45d1-8e9d-56a591b27a26 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B874:15C919:1058F99:15C1FD9:6A5296E2 |
| html-safe-nonce | 9ecd92e526814ace37248dbcb23bda73c1ce06094ba6d463b03fa9327ab1c2c2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODc0OjE1QzkxOToxMDU4Rjk5OjE1QzFGRDk6NkE1Mjk2RTIiLCJ2aXNpdG9yX2lkIjoiNjY3MDIwMDI3OTY2ODAwNDU3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 866bcbd40d98cdcb45be2198da98db9869d086e8f7ed37c968bc17803fc1667a |
| hovercard-subject-tag | issue:485712158 |
| 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/15142/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6de2cfbaf84c83b32c2a8002c0a60b97dec0071c7a74a8baba99538ca4703b0f/matplotlib/matplotlib/issues/15142 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6de2cfbaf84c83b32c2a8002c0a60b97dec0071c7a74a8baba99538ca4703b0f/matplotlib/matplotlib/issues/15142 |
| og:image:alt | Bug report Bug summary I wanted to update my code that annotates a plot by changed the deprecated keyword argument s to text as described in the documentation of matplotlib v3.1.1. However it fails... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | amaeckelberghe |
| 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