Title: [Bug]: axes.prop_cycle behavior change · Issue #29915 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: axes.prop_cycle behavior change · Issue #29915 · matplotlib/matplotlib
X Title: [Bug]: axes.prop_cycle behavior change · Issue #29915 · matplotlib/matplotlib
Description: PR #29808 (identified by git bisect) changed the behavior of: $ python -c 'import matplotlib; print(matplotlib.rcParams.get("axes.prop_cycle").by_key()["color"])' ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c...
Open Graph Description: PR #29808 (identified by git bisect) changed the behavior of: $ python -c 'import matplotlib; print(matplotlib.rcParams.get("axes.prop_cycle").by_key()["color"])' ['#1f77b4', '#ff7f0e', '#2ca02c', ...
X Description: PR #29808 (identified by git bisect) changed the behavior of: $ python -c 'import matplotlib; print(matplotlib.rcParams.get("axes.prop_cycle").by_key()["color"])' ['...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29915
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: axes.prop_cycle behavior change","articleBody":"PR #29808 (identified by `git bisect`) changed the behavior of:\n```\n$ python -c 'import matplotlib; print(matplotlib.rcParams.get(\"axes.prop_cycle\").by_key()[\"color\"])'\n['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf']\n```\nto now be a list of tuple of float rather than a list of str:\n```\n$ python -c 'import matplotlib; print(matplotlib.rcParams.get(\"axes.prop_cycle\").by_key()[\"color\"])'\n[(0.12156862745098039, 0.4666666666666667, 0.7058823529411765), (1.0, 0.4980392156862745, 0.054901960784313725), (0.17254901960784313, 0.6274509803921569, 0.17254901960784313), (0.8392156862745098, 0.15294117647058825, 0.1568627450980392), (0.5803921568627451, 0.403921568627451, 0.7411764705882353), (0.5490196078431373, 0.33725490196078434, 0.29411764705882354), (0.8901960784313725, 0.4666666666666667, 0.7607843137254902), (0.4980392156862745, 0.4980392156862745, 0.4980392156862745), (0.7372549019607844, 0.7411764705882353, 0.13333333333333333), (0.09019607843137255, 0.7450980392156863, 0.8117647058823529)]\n```\nThis is potentially problematic for end-users. MNE-Python we know the default `prop_cycle` (and everyone seems to use it!) so make use of the fact that we know `#7f7f7f` is in there, remove it, and create a new cycle. Our code now breaks with:\n```\n self.color_list.remove(\"#7f7f7f\")\nValueError: list.remove(x): x not in list\n```\nAnd yes we should make our check better (e.g., remove any color sufficiently close to the bad color, etc.) but it seems like a potential regression that this behavior has changed in any case. Feel free to close if not!","author":{"url":"https://github.com/larsoner","@type":"Person","name":"larsoner"},"datePublished":"2025-04-14T14:33:52.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/29915/matplotlib/issues/29915"}
| 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:f123e53c-9e60-4b41-9c02-d6d2f2e05359 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E35E:26AD97:C59B19:1092A43:6A528710 |
| html-safe-nonce | 1eb89efcd48c5a2c167cdf458992e2f67dfa619133f35806b01e5ba6c78f5f9c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzVFOjI2QUQ5NzpDNTlCMTk6MTA5MkE0Mzo2QTUyODcxMCIsInZpc2l0b3JfaWQiOiIzNDk5Mzk1ODE2NzU3NTYxMTA0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | babddc2ff403dd503a612f6d3caa6eea2204db665987423f1f47d184169c25c6 |
| hovercard-subject-tag | issue:2993273127 |
| 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/29915/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5bc275c468467087bbb222b45231b7e5027dc5f9d04fff21497e18aab1c0d9ad/matplotlib/matplotlib/issues/29915 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5bc275c468467087bbb222b45231b7e5027dc5f9d04fff21497e18aab1c0d9ad/matplotlib/matplotlib/issues/29915 |
| og:image:alt | PR #29808 (identified by git bisect) changed the behavior of: $ python -c 'import matplotlib; print(matplotlib.rcParams.get("axes.prop_cycle").by_key()["color"])' ['#1f77b4', '#ff7f0e', '#2ca02c', ... |
| 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 | 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