Title: Issue · GitHub
Open Graph Title: Issue · matplotlib/matplotlib
X Title: Issue · matplotlib/matplotlib
Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.
Open Graph Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.
X Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.
Opengraph URL: https://github.com/matplotlib/matplotlib
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"toolbar.update() breaks history","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\nI'm looking for resetting the zoom and pan history of interactve browsing. Using `toolbar.update()` breaks the interactive history, it's not possible to go back to the previous axis state.\r\n\r\n**Code for reproduction**\r\n\r\nRun this code in python a console:\r\n```python\r\nfrom matplotlib import pyplot as plt\r\nf = plt.figure()\r\nplt.plot([1, 2, 5])\r\nplt.show(block=False)\r\nf.canvas.toolbar._views._elements # One element\r\nf.canvas.toolbar._positions._elements # One element\r\nf.canvas.toolbar.update()\r\nf.canvas.toolbar._views._elements # Empty !\r\nf.canvas.toolbar._positions._elements # Empty !\r\n# Zoom once\r\n# Try to go back using the home button or back arrow\r\n```\r\n\r\n**Actual outcome**\r\n\r\nThe view doesn't change when pressing home button or back arrow\r\n\r\n**Expected outcome**\r\n\r\nI expect to be able to got back to the state the plot was in when `f.canvas.toolbar.update()` was called, but since the history is completely empty, there is no state to go back to. I think the current state should be added right after clearing the history. Is it possible to do it manually in the meantime ?\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: Arch Linux\r\n * Matplotlib version: 2.1.0-1\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): Qt5Agg\r\n * Python version: 3.6.3\r\n * Jupyter version (if applicable):\r\n * Other libraries: \r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\n\r\n","author":{"url":"https://github.com/Nodd","@type":"Person","name":"Nodd"},"datePublished":"2017-12-11T15:25:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/9974/matplotlib/issues/9974"}
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:9570ff22-f21a-f4ae-a548-f590edbe486d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C884:2A0FAF:8DE61B:C38AFA:6A5392FD |
| html-safe-nonce | 956bcfccda726a649f6e2d9077b142acfe12caa988289071bf0ce821383cb129 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODg0OjJBMEZBRjo4REU2MUI6QzM4QUZBOjZBNTM5MkZEIiwidmlzaXRvcl9pZCI6IjQ5OTE3MzkzODI2NTI0NDEzNDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0639823d0c32128f01967b15343f370f3dd52c645dbddd30f37932e7a3ca98e3 |
| hovercard-subject-tag | repository:1385122 |
| 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/matplotlib/matplotlib/issues/9974 |
| twitter:image | https://opengraph.githubassets.com/da3717e6a83f542c01acc8b29c6ba51dfbca02ffc2e01ed498a541326027c167/matplotlib/matplotlib |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/da3717e6a83f542c01acc8b29c6ba51dfbca02ffc2e01ed498a541326027c167/matplotlib/matplotlib |
| og:image:alt | matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub. |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-cache |
| 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 | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width