Title: [Bug]: First invocation of plt.plot() resets mpl.rcParams['figure.dpi'] · Issue #23007 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: First invocation of plt.plot() resets mpl.rcParams['figure.dpi'] · Issue #23007 · matplotlib/matplotlib
X Title: [Bug]: First invocation of plt.plot() resets mpl.rcParams['figure.dpi'] · Issue #23007 · matplotlib/matplotlib
Description: Bug summary First invocation of plt.plot() resets mpl.rcParams['figure.dpi']. Code for reproduction # Only tested in Jupyter import matplotlib as mpl import matplotlib.pyplot as plt mpl.rcParams['figure.dpi'] = 300 print(mpl.rcParams['fi...
Open Graph Description: Bug summary First invocation of plt.plot() resets mpl.rcParams['figure.dpi']. Code for reproduction # Only tested in Jupyter import matplotlib as mpl import matplotlib.pyplot as plt mpl.rcParams['f...
X Description: Bug summary First invocation of plt.plot() resets mpl.rcParams['figure.dpi']. Code for reproduction # Only tested in Jupyter import matplotlib as mpl import matplotlib.pyplot as plt mpl.rcP...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/23007
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: First invocation of plt.plot() resets mpl.rcParams['figure.dpi']","articleBody":"### Bug summary\r\n\r\nFirst invocation of `plt.plot()` resets `mpl.rcParams['figure.dpi']`.\r\n\r\n### Code for reproduction\r\n\r\n```python\r\n# Only tested in Jupyter\r\n\r\nimport matplotlib as mpl\r\nimport matplotlib.pyplot as plt\r\n\r\nmpl.rcParams['figure.dpi'] = 300\r\n\r\nprint(mpl.rcParams['figure.dpi'])\r\nplt.plot()\r\nprint(mpl.rcParams['figure.dpi'])\r\n```\r\n\r\n\r\n### Actual outcome\r\n\r\n300.0\r\n72.0\r\n\r\n### Expected outcome\r\n\r\n300.0\r\n300.0\r\n\r\n### Additional information\r\n\r\nThis happens only at the very first invocation of `plt.plot()`, while on subsequent `plt.plot()` calls `mpl.rcParams['figure.dpi']` will no longer be overwritten.\r\n\r\nOther `rcParams` values seem not to be affected (but I've not tested them all).\r\n\r\nI have never observed this behavior in any of the previous matplotlib versions, so the bug must have been introduced in the latest version (3.5.2).\r\n\r\n### Operating system\r\n\r\nWindows 10\r\n\r\n### Matplotlib Version\r\n\r\n3.5.2\r\n\r\n### Matplotlib Backend\r\n\r\nmodule://matplotlib_inline.backend_inline\r\n\r\n### Python version\r\n\r\nPython 3.9.12\r\n\r\n### Jupyter version\r\n\r\n3.4.0\r\n\r\n### Installation\r\n\r\nconda","author":{"url":"https://github.com/emazep","@type":"Person","name":"emazep"},"datePublished":"2022-05-07T19:31:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/23007/matplotlib/issues/23007"}
| 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:628cecb7-2b00-dc18-8362-2f4538c741d1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E1AC:384A5F:CFC6F:11DD36:6A5326D2 |
| html-safe-nonce | 6f073356979db289c29e2af79a5653641b80cb2c04478f87dba2fa727eeab655 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMUFDOjM4NEE1RjpDRkM2RjoxMUREMzY6NkE1MzI2RDIiLCJ2aXNpdG9yX2lkIjoiMjEzNDcyMTY5MTMzNDY4MjMyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7c4a0dc3ffa82148e00fdfe979168cc7e970f96aa69a4e2b4bc1f852d398b662 |
| hovercard-subject-tag | issue:1228705571 |
| 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/23007/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a3f420b028a1931a9a6d1ad616bc526904e69e1f6c1b45783e4ff4ae91dd35c0/matplotlib/matplotlib/issues/23007 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a3f420b028a1931a9a6d1ad616bc526904e69e1f6c1b45783e4ff4ae91dd35c0/matplotlib/matplotlib/issues/23007 |
| og:image:alt | Bug summary First invocation of plt.plot() resets mpl.rcParams['figure.dpi']. Code for reproduction # Only tested in Jupyter import matplotlib as mpl import matplotlib.pyplot as plt mpl.rcParams['f... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | emazep |
| 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