Title: [Bug]: Regression in dashes due to #22569 · Issue #22930 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Regression in dashes due to #22569 · Issue #22930 · matplotlib/matplotlib
X Title: [Bug]: Regression in dashes due to #22569 · Issue #22930 · matplotlib/matplotlib
Description: Bug summary Previously working plotting code has broken. It fails on 96ddc67 / #22569 but passes on the parent daaa1ed. Code for reproduction import matplotlib.pyplot as plt fig, ax = plt.subplots() ax.plot([0, 1], [0, 1], ls=(0, ())) pl...
Open Graph Description: Bug summary Previously working plotting code has broken. It fails on 96ddc67 / #22569 but passes on the parent daaa1ed. Code for reproduction import matplotlib.pyplot as plt fig, ax = plt.subplots(...
X Description: Bug summary Previously working plotting code has broken. It fails on 96ddc67 / #22569 but passes on the parent daaa1ed. Code for reproduction import matplotlib.pyplot as plt fig, ax = plt.subplots(...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/22930
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Regression in dashes due to #22569","articleBody":"### Bug summary\n\nPreviously working plotting code has broken. It fails on 96ddc6728ce09cb61f6b6c53714755fe0936b106 / #22569 but passes on the parent daaa1ed376b4fc60ed5a20d155a13c6361aee479.\n\n### Code for reproduction\n\n```python\nimport matplotlib.pyplot as plt\r\nfig, ax = plt.subplots()\r\nax.plot([0, 1], [0, 1], ls=(0, ()))\r\nplt.show()\n```\n\n\n### Actual outcome\n\nNo line shown, error while drawing\r\n```\r\n File \"/home/larsoner/python/matplotlib/lib/matplotlib/backends/backend_qt.py\", line 479, in _draw_idle\r\n self.draw()\r\n File \"/home/larsoner/python/matplotlib/lib/matplotlib/backends/backend_agg.py\", line 424, in draw\r\n self.figure.draw(self.renderer)\r\n File \"/home/larsoner/python/matplotlib/lib/matplotlib/artist.py\", line 73, in draw_wrapper\r\n result = draw(artist, renderer, *args, **kwargs)\r\n File \"/home/larsoner/python/matplotlib/lib/matplotlib/artist.py\", line 50, in draw_wrapper\r\n return draw(artist, renderer)\r\n File \"/home/larsoner/python/matplotlib/lib/matplotlib/figure.py\", line 2860, in draw\r\n mimage._draw_list_compositing_images(\r\n File \"/home/larsoner/python/matplotlib/lib/matplotlib/image.py\", line 131, in _draw_list_compositing_images\r\n a.draw(renderer)\r\n File \"/home/larsoner/python/matplotlib/lib/matplotlib/artist.py\", line 50, in draw_wrapper\r\n return draw(artist, renderer)\r\n File \"/home/larsoner/python/matplotlib/lib/matplotlib/axes/_base.py\", line 3101, in draw\r\n mimage._draw_list_compositing_images(\r\n File \"/home/larsoner/python/matplotlib/lib/matplotlib/image.py\", line 131, in _draw_list_compositing_images\r\n a.draw(renderer)\r\n File \"/home/larsoner/python/matplotlib/lib/matplotlib/artist.py\", line 50, in draw_wrapper\r\n return draw(artist, renderer)\r\n File \"/home/larsoner/python/matplotlib/lib/matplotlib/lines.py\", line 772, in draw\r\n gc.set_dashes(*self._dash_pattern)\r\n File \"/home/larsoner/python/matplotlib/lib/matplotlib/backend_bases.py\", line 930, in set_dashes\r\n raise ValueError(\r\nValueError: At least one value in the dash list must be positive\r\n```\n\n### Expected outcome\n\nLine shown\r\n\r\n\r\n\r\n\n\n### Additional information\n\nMaybe we use a weird/bad/incorrect convention in our code by creating `ls=(0, ())` and we can certainly work around it/fix it, but it used to work at least! At a minimum it might be nice to raise a nicer error if possible...\n\n### Operating system\n\nUbuntu 22.04\n\n### Matplotlib Version\n\n96ddc6728ce09cb61f6b6c53714755fe0936b106\n\n### Matplotlib Backend\n\nQtAgg (PyQt6)\n\n### Python version\n\n3.10.4\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\ngit checkout","author":{"url":"https://github.com/larsoner","@type":"Person","name":"larsoner"},"datePublished":"2022-04-28T16:07:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/22930/matplotlib/issues/22930"}
| 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:0cd67597-f565-7b46-a557-db8f24fd3317 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8A52:16C3D3:4544B4F:6229563:6A4FBD0E |
| html-safe-nonce | e36687608e1dfaf9b4380000037a577b4c7c219bff2814ce74f867e8a78a546b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTUyOjE2QzNEMzo0NTQ0QjRGOjYyMjk1NjM6NkE0RkJEMEUiLCJ2aXNpdG9yX2lkIjoiNzM4NjI5NzA0MDQ3NjM5ODIyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 64dad8ee926e2f124c6465f94bcf6e194fbbd4b6c5f6ac49c45971fdfccdcd79 |
| hovercard-subject-tag | issue:1218953481 |
| 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/22930/issue_layout |
| twitter:image | https://opengraph.githubassets.com/34a2947d2f81b4ab56ec6016cc78c528c66f4f318d41f7560b8b5f719367b47c/matplotlib/matplotlib/issues/22930 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/34a2947d2f81b4ab56ec6016cc78c528c66f4f318d41f7560b8b5f719367b47c/matplotlib/matplotlib/issues/22930 |
| og:image:alt | Bug summary Previously working plotting code has broken. It fails on 96ddc67 / #22569 but passes on the parent daaa1ed. Code for reproduction import matplotlib.pyplot as plt fig, ax = plt.subplots(... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | larsoner |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d8f8209b188a80e19a6957836ab9229715797be5db1a04163963c674ccc33f6 |
| 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 | ea848e83cf3bf3613dd7b13d52965a684fd23ec5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width