Title: [Bug]: Line2D.set_linestyle treats dash pattern with None onoffseq as dashed · Issue #23437 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Line2D.set_linestyle treats dash pattern with None onoffseq as dashed · Issue #23437 · matplotlib/matplotlib
X Title: [Bug]: Line2D.set_linestyle treats dash pattern with None onoffseq as dashed · Issue #23437 · matplotlib/matplotlib
Description: Bug summary The logic for setting linestyle using a dash tuple, i.e. (offset, onoffseq), does not properly handle the case where onoffseq is None. Code for reproduction print(mpl.lines.Line2D([], [], linestyle=(0, None)).get_linestyle())...
Open Graph Description: Bug summary The logic for setting linestyle using a dash tuple, i.e. (offset, onoffseq), does not properly handle the case where onoffseq is None. Code for reproduction print(mpl.lines.Line2D([], [...
X Description: Bug summary The logic for setting linestyle using a dash tuple, i.e. (offset, onoffseq), does not properly handle the case where onoffseq is None. Code for reproduction print(mpl.lines.Line2D([], [...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/23437
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Line2D.set_linestyle treats dash pattern with None onoffseq as dashed","articleBody":"### Bug summary\r\n\r\nThe logic for setting linestyle using a dash tuple, i.e. `(offset, onoffseq)`, does not properly handle the case where `onoffseq` is `None`.\r\n\r\n### Code for reproduction\r\n\r\n```python\r\nprint(mpl.lines.Line2D([], [], linestyle=(0, None)).get_linestyle())\r\n```\r\n\r\n\r\n### Actual outcome\r\n\r\n`'--'`\r\n\r\n### Expected outcome\r\n\r\nIdeally, dash values would roundtrip, so the return would be `(0, None)`. Even when the dash sequence is not `None`, a lot of information is lost when this property is queried.\r\n\r\nBut more narrowly, `(0, None)` draws a solid line, so the return value should be `'-'`.\r\n\r\n### Additional information\r\n\r\nThe main consequence here is that the line's capstyle appears to conditionally read from `solid_capstyle` or `dash_capstyle` depending on the `get_linestyle` return value.\r\n\r\n### Matplotlib Version\r\n\r\n3.5.2","author":{"url":"https://github.com/mwaskom","@type":"Person","name":"mwaskom"},"datePublished":"2022-07-16T21:18:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/23437/matplotlib/issues/23437"}
| 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:f0027e7a-535a-46cc-0549-f2d4adf8132a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A99A:FE029:2930019:3B28032:6A4FAC6F |
| html-safe-nonce | ea2c5b5cb1475a7829a67474cf29de0ffef06a55b75d8ee983e1c46bf5d0ce1d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTlBOkZFMDI5OjI5MzAwMTk6M0IyODAzMjo2QTRGQUM2RiIsInZpc2l0b3JfaWQiOiI1MTU0MDkxNDY1NzIzMzI1NTUxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ab6dddeb9d5c642c4f0720c97133ebc68ddd832c007341c8a9573cf0fa5bb40b |
| hovercard-subject-tag | issue:1306905484 |
| 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/23437/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6f9716dc58684f47aba0c6592288ac66a07a63599437dd30a5c4bfc0c726de62/matplotlib/matplotlib/issues/23437 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6f9716dc58684f47aba0c6592288ac66a07a63599437dd30a5c4bfc0c726de62/matplotlib/matplotlib/issues/23437 |
| og:image:alt | Bug summary The logic for setting linestyle using a dash tuple, i.e. (offset, onoffseq), does not properly handle the case where onoffseq is None. Code for reproduction print(mpl.lines.Line2D([], [... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mwaskom |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| 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 | 4b249b445842943ed31549e027f57a8ade9881ed |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width