Title: Sliders unresponsive when created inside a function · Issue #3105 · matplotlib/matplotlib · GitHub
Open Graph Title: Sliders unresponsive when created inside a function · Issue #3105 · matplotlib/matplotlib
X Title: Sliders unresponsive when created inside a function · Issue #3105 · matplotlib/matplotlib
Description: When a Slider is created inside a function, it is typically non-responsive (does not react to the mouse): from matplotlib import pyplot from matplotlib.widgets import Slider sliders = [] def open_fig_with_slider(): pyplot.figure() slider...
Open Graph Description: When a Slider is created inside a function, it is typically non-responsive (does not react to the mouse): from matplotlib import pyplot from matplotlib.widgets import Slider sliders = [] def open_f...
X Description: When a Slider is created inside a function, it is typically non-responsive (does not react to the mouse): from matplotlib import pyplot from matplotlib.widgets import Slider sliders = [] def open_f...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/3105
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Sliders unresponsive when created inside a function","articleBody":"When a Slider is created inside a function, it is typically non-responsive (does not react to the mouse):\n\n```\nfrom matplotlib import pyplot\nfrom matplotlib.widgets import Slider\n\nsliders = []\n\ndef open_fig_with_slider():\n pyplot.figure()\n slider = Slider(pyplot.axes([0.25, 0.1, 0.65, 0.03]),\n 'Slider', 0, 1, valinit=0.5)\n # sliders.append(slider)\n\nopen_fig_with_slider()\npyplot.show() # The slider is unresponsive unless append above is un-commented\n```\n\nThe problem appears to be fixed by keeping a reference to the slider. The closest thing I've found in the documentation is that a canvas only keeps weak references to its _callbacks_ (http://matplotlib.org/users/event_handling.html). However, the connection with sliders is not so obvious—if there is any.\n\nIf I'm not mistaken, this behavior is not documented, so it would be nice to add it to the documentation, if it is normal. \n","author":{"url":"https://github.com/lebigot","@type":"Person","name":"lebigot"},"datePublished":"2014-06-02T09:08:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/3105/matplotlib/issues/3105"}
| 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:7eeca442-3867-ca6b-bb2e-0a0c3a1400cc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C0C6:2DCEA7:9544D5:C546C8:6A531405 |
| html-safe-nonce | ec249c0a73f22271bb64da40f2bcc525400f5befd7cc4a4ffcac9b26093c6a87 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMEM2OjJEQ0VBNzo5NTQ0RDU6QzU0NkM4OjZBNTMxNDA1IiwidmlzaXRvcl9pZCI6IjgyNTI4NzE1NDY0NTI3NTY1MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7692dced70487673eb3ae7fc8e49b231128d5e6f374eb2e68df22ac002bd65ea |
| hovercard-subject-tag | issue:34756161 |
| 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/3105/issue_layout |
| twitter:image | https://opengraph.githubassets.com/13cbad1cba0d14376314bde63b5d0c44518887bf353be44f7a35a2c2e5d9c27e/matplotlib/matplotlib/issues/3105 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/13cbad1cba0d14376314bde63b5d0c44518887bf353be44f7a35a2c2e5d9c27e/matplotlib/matplotlib/issues/3105 |
| og:image:alt | When a Slider is created inside a function, it is typically non-responsive (does not react to the mouse): from matplotlib import pyplot from matplotlib.widgets import Slider sliders = [] def open_f... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lebigot |
| 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