Title: clone more legend settings when regenerating in Qt figure options dialog · Issue #17775 · matplotlib/matplotlib · GitHub
Open Graph Title: clone more legend settings when regenerating in Qt figure options dialog · Issue #17775 · matplotlib/matplotlib
X Title: clone more legend settings when regenerating in Qt figure options dialog · Issue #17775 · matplotlib/matplotlib
Description: Bug report xref https://stackoverflow.com/questions/62602933/matplotlib-navigation-toolbar-resets-legendstyle The logic to regenerate the legend in the Qt figure option window discards most of the custom state set on the legend. Bug summ...
Open Graph Description: Bug report xref https://stackoverflow.com/questions/62602933/matplotlib-navigation-toolbar-resets-legendstyle The logic to regenerate the legend in the Qt figure option window discards most of the ...
X Description: Bug report xref https://stackoverflow.com/questions/62602933/matplotlib-navigation-toolbar-resets-legendstyle The logic to regenerate the legend in the Qt figure option window discards most of the ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/17775
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"clone more legend settings when regenerating in Qt figure options dialog","articleBody":"\r\n### Bug report\r\n\r\nxref https://stackoverflow.com/questions/62602933/matplotlib-navigation-toolbar-resets-legendstyle\r\n\r\nThe logic to regenerate the legend in the Qt figure option window discards most of the custom state set on the legend.\r\n\r\n**Bug summary**\r\n\r\nThe logic that regenerate the legend pulls only ncols and if the legend is draggable\r\n\r\nhttps://github.com/matplotlib/matplotlib/blob/e73d4e056588abc201335d8a491fd9cb37d4c296/lib/matplotlib/backends/qt_editor/figureoptions.py#L237-L246\r\n\r\nbut nothing else. \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 .pyplot as plt\r\nfig, ax = plt.subplots()\r\nax.plot(range(5), label='a')\r\nax.plot(range(3)[::-1], label='b')\r\nax.legend(bbox_to_anchor=(0,1.02,1,0.2), loc=\"lower left\", mode=\"expand\", borderaxespad=0, ncol=3)\r\nplt.show()\r\n```\r\n\r\nopen the figure options, tick \"(Re)-generate legend\" and hit OK or apply\r\n\r\n**Actual outcome**\r\n\r\nThe legend settings are discarded when the figure is re-generated\r\n\r\n**Expected outcome**\r\n\r\nThe `bbox_to_anchor`, `loc`,... settings to be re-used.\r\n\r\n\u003c!--A description of the expected outcome from the code snippet--\u003e\r\n\u003c!--If this used to work in an earlier version of Matplotlib, please note the version it used to work on--\u003e\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: any\r\n * Matplotlib version: 3.2+\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): Qt5Agg (any Qt5 backend)\r\n * Python version: Any\r\n\r\ninstalled from source\r\n","author":{"url":"https://github.com/tacaswell","@type":"Person","name":"tacaswell"},"datePublished":"2020-06-27T00:09:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/17775/matplotlib/issues/17775"}
| 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:4aa65ddd-98c8-b0c9-d8e4-41b465db7b63 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CE02:34DD25:E68911:1342289:6A543F6C |
| html-safe-nonce | acea57fad98b0bf5c93aa2d480549092c1da0b57fa0b1866a2bd38cb2001210f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRTAyOjM0REQyNTpFNjg5MTE6MTM0MjI4OTo2QTU0M0Y2QyIsInZpc2l0b3JfaWQiOiIzNTUxNzE3MzY2MDU1NTgzNTk3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c9d9271b339502ca9a895ccc2723efacdba561239342160ff7c5158c80ce30b6 |
| hovercard-subject-tag | issue:646567840 |
| 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/17775/issue_layout |
| twitter:image | https://opengraph.githubassets.com/614fb61e0a393e1dae9a2def7d25a206eca68ee5c5b30855ec1e9a457bec3130/matplotlib/matplotlib/issues/17775 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/614fb61e0a393e1dae9a2def7d25a206eca68ee5c5b30855ec1e9a457bec3130/matplotlib/matplotlib/issues/17775 |
| og:image:alt | Bug report xref https://stackoverflow.com/questions/62602933/matplotlib-navigation-toolbar-resets-legendstyle The logic to regenerate the legend in the Qt figure option window discards most of the ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tacaswell |
| 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