Title: Using a linestyle cycler with plt.errorbar results in strange plots · Issue #7074 · matplotlib/matplotlib · GitHub
Open Graph Title: Using a linestyle cycler with plt.errorbar results in strange plots · Issue #7074 · matplotlib/matplotlib
X Title: Using a linestyle cycler with plt.errorbar results in strange plots · Issue #7074 · matplotlib/matplotlib
Description: If the linestyles used in a plt.errorbar plot are adjusted manually, results are as expected. However, when using a linestyle cycler, the linestyles are simply ignored whereas using a ls cycler results in errorbar end points being connec...
Open Graph Description: If the linestyles used in a plt.errorbar plot are adjusted manually, results are as expected. However, when using a linestyle cycler, the linestyles are simply ignored whereas using a ls cycler res...
X Description: If the linestyles used in a plt.errorbar plot are adjusted manually, results are as expected. However, when using a linestyle cycler, the linestyles are simply ignored whereas using a ls cycler res...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/7074
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Using a linestyle cycler with plt.errorbar results in strange plots","articleBody":"If the linestyles used in a `plt.errorbar` plot are adjusted manually, results are as expected. However, when using a `linestyle` cycler, the linestyles are simply ignored whereas using a `ls` cycler results in errorbar end points being connected by lines.\n\nConsider the following minimal example\n\n``` python\nimport numpy as np\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nfrom cycler import cycler\n\nx = np.arange(0.1, 4, 0.5)\ny = np.exp(-x)\noffsets = [0, 1]\n\n\nlinestyles = ['-', '--']\n\nplt.figure()\nfor offset, linestyle in zip(offsets, linestyles):\n plt.errorbar(x, y + offset, xerr=0.1, yerr=0.3, ls=linestyle, color='b')\nplt.title('manual plots')\nplt.savefig('manual_plots.png')\n\n\nlinestyle_cycle = cycler('linestyle', linestyles)\nmpl.rcParams['axes.prop_cycle'] = linestyle_cycle\n\nplt.figure()\nfor offset in offsets:\n plt.errorbar(x, y + offset, xerr=0.1, yerr=0.3, color='b')\nplt.title('Linestyle cycler plots')\nplt.savefig('linestyle_cycler_plots.png')\n\n\nls_cycle = cycler('ls', linestyles)\nmpl.rcParams['axes.prop_cycle'] = ls_cycle\n\nplt.figure()\nfor offset in offsets:\n plt.errorbar(x, y + offset, xerr=0.1, yerr=0.3, color='b')\nplt.title('ls cycler plots')\nplt.savefig('ls_cycler_plots.png')\n```\n\nwhich produces the following set of figures\n\n\n\n\n\nI ran the above example using Anaconda 4.1.1 with Python 3.5.2 and Matplotlib 1.5.1 on Linux.\n","author":{"url":"https://github.com/Chroxvi","@type":"Person","name":"Chroxvi"},"datePublished":"2016-09-09T13:44:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/7074/matplotlib/issues/7074"}
| 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:095edc93-431a-c8c3-8455-4e2b75601e42 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C26:1A362E:672020:8A2168:6A52FDDC |
| html-safe-nonce | df0e8487b8c01f56283413ec68e0a23130c32b58be91f50d8b48528dab907391 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzI2OjFBMzYyRTo2NzIwMjA6OEEyMTY4OjZBNTJGRERDIiwidmlzaXRvcl9pZCI6Ijg2Mjc1NTYxNjIyNDQ2NDAyMjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 26d0afc15485b6151b1c45dce1fffa99c1b4b04d0dd51e89751dc17928c19a1b |
| hovercard-subject-tag | issue:176013237 |
| 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/7074/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1fe4306912cd78de0dea802f455c9c6e47f3feb0ad1e9a2f4491d8e88015bfd1/matplotlib/matplotlib/issues/7074 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1fe4306912cd78de0dea802f455c9c6e47f3feb0ad1e9a2f4491d8e88015bfd1/matplotlib/matplotlib/issues/7074 |
| og:image:alt | If the linestyles used in a plt.errorbar plot are adjusted manually, results are as expected. However, when using a linestyle cycler, the linestyles are simply ignored whereas using a ls cycler res... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Chroxvi |
| 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