Title: Temporary styling ignores color cycle · Issue #11376 · matplotlib/matplotlib · GitHub
Open Graph Title: Temporary styling ignores color cycle · Issue #11376 · matplotlib/matplotlib
X Title: Temporary styling ignores color cycle · Issue #11376 · matplotlib/matplotlib
Description: Bug report Bug summary With temporary styling, using colors with respect to the color cycle, like 'C0', is ignored if plt.show() is called outside of the with block. It only works properly if plt.show() is called inside the block. Code f...
Open Graph Description: Bug report Bug summary With temporary styling, using colors with respect to the color cycle, like 'C0', is ignored if plt.show() is called outside of the with block. It only works properly if plt.s...
X Description: Bug report Bug summary With temporary styling, using colors with respect to the color cycle, like 'C0', is ignored if plt.show() is called outside of the with block. It only works properly ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/11376
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Temporary styling ignores color cycle","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\n\r\nWith temporary styling, using colors with respect to the color cycle, like `'C0'`, is ignored if `plt.show()` is called outside of the `with` block. It only works properly if `plt.show()` is called inside the block.\r\n\r\n**Code for reproduction**\r\n\r\nThis reproduces the bug:\r\n```python\r\nimport matplotlib.pyplot as plt\r\n\r\nwith plt.style.context('seaborn'):\r\n plt.axhline(0, color='C0')\r\n plt.axhline(1, color='C1')\r\n plt.axhline(2, color='C2')\r\nplt.show()\r\n```\r\n\r\nThis works fine and is the expected behavior:\r\n```python\r\nimport matplotlib.pyplot as plt\r\n\r\nwith plt.style.context('seaborn'):\r\n plt.axhline(0, color='C0')\r\n plt.axhline(1, color='C1')\r\n plt.axhline(2, color='C2')\r\n plt.show()\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\r\n\r\nPlease note that other elements of the style are working fine, such as the grid.\r\n\r\n**Expected outcome**\r\n\r\n\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: Solus Linux\r\n * Matplotlib version: 2.2.2\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): TkAgg\r\n * Python version: 3.6.5\r\n\r\nUsing matplotlib packaged by the linux distribution.\r\n","author":{"url":"https://github.com/rjurga","@type":"Person","name":"rjurga"},"datePublished":"2018-06-05T07:57:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/11376/matplotlib/issues/11376"}
| 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:e1c0d2a0-03c8-da9d-8820-894f7fd2ca7c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8D28:276C72:1C2C1B4:265C45A:6A537394 |
| html-safe-nonce | d2022bc1b635148f1e75685e09fbc48ef43813f57e0ed185c65e38a4b76e4ae2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDI4OjI3NkM3MjoxQzJDMUI0OjI2NUM0NUE6NkE1MzczOTQiLCJ2aXNpdG9yX2lkIjoiMzI2NTA5MTQxMzU5MTk0NjEzMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | bf50844657850dd85af30105e611247744452b18796e890b572f1745f80e2df2 |
| hovercard-subject-tag | issue:329341647 |
| 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/11376/issue_layout |
| twitter:image | https://opengraph.githubassets.com/82ba3b666de37a68505d875b331268c5cacc2764f3a5246f95d12edef603bd57/matplotlib/matplotlib/issues/11376 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/82ba3b666de37a68505d875b331268c5cacc2764f3a5246f95d12edef603bd57/matplotlib/matplotlib/issues/11376 |
| og:image:alt | Bug report Bug summary With temporary styling, using colors with respect to the color cycle, like 'C0', is ignored if plt.show() is called outside of the with block. It only works properly if plt.s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rjurga |
| 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