Title: [Bug]: plt.errorbar error for all-nan xerr and yerr · Issue #25549 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: plt.errorbar error for all-nan xerr and yerr · Issue #25549 · matplotlib/matplotlib
X Title: [Bug]: plt.errorbar error for all-nan xerr and yerr · Issue #25549 · matplotlib/matplotlib
Description: Bug summary plt.errorbar don't give result when only nan data in the xerr or yerr. This is similar to issue #24127. Code for reproduction import numpy as np import matplotlib.pyplot as plt plt.errorbar(x=[0], y=[0], xerr =[np.nan], yerr=...
Open Graph Description: Bug summary plt.errorbar don't give result when only nan data in the xerr or yerr. This is similar to issue #24127. Code for reproduction import numpy as np import matplotlib.pyplot as plt plt.erro...
X Description: Bug summary plt.errorbar don't give result when only nan data in the xerr or yerr. This is similar to issue #24127. Code for reproduction import numpy as np import matplotlib.pyplot as plt plt....
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/25549
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: plt.errorbar error for all-nan xerr and yerr","articleBody":"### Bug summary\r\n\r\n`plt.errorbar` don't give result when only nan data in the xerr or yerr. This is similar to issue #24127.\r\n\r\n### Code for reproduction\r\n\r\n```python\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nplt.errorbar(x=[0], y=[0], xerr =[np.nan], yerr=[np.nan])\r\nplt.show()\r\n```\r\n\r\n\r\n### Actual outcome\r\n\r\n\u003e ---------------------------------------------------------------------------\r\nStopIteration Traceback (most recent call last)\r\n[\u003cipython-input-12-e7cb66e16887\u003e](https://localhost:8080/#) in \u003cmodule\u003e\r\n 1 import numpy as np\r\n 2 import matplotlib.pyplot as plt\r\n----\u003e 3 plt.errorbar(x=[0], y=[0], xerr =[np.nan], yerr=[np.nan])\r\n 4 plt.show()\r\n\r\n4 frames\r\n[/usr/local/lib/python3.9/dist-packages/matplotlib/pyplot.py](https://localhost:8080/#) in errorbar(x, y, yerr, xerr, fmt, ecolor, elinewidth, capsize, barsabove, lolims, uplims, xlolims, xuplims, errorevery, capthick, data, **kwargs)\r\n 2562 uplims=False, xlolims=False, xuplims=False, errorevery=1,\r\n 2563 capthick=None, *, data=None, **kwargs):\r\n-\u003e 2564 return gca().errorbar(\r\n 2565 x, y, yerr=yerr, xerr=xerr, fmt=fmt, ecolor=ecolor,\r\n 2566 elinewidth=elinewidth, capsize=capsize, barsabove=barsabove,\r\n\r\n[/usr/local/lib/python3.9/dist-packages/matplotlib/__init__.py](https://localhost:8080/#) in inner(ax, data, *args, **kwargs)\r\n 1440 def inner(ax, *args, data=None, **kwargs):\r\n 1441 if data is None:\r\n-\u003e 1442 return func(ax, *map(sanitize_sequence, args), **kwargs)\r\n 1443 \r\n 1444 bound = new_sig.bind(ax, *args, **kwargs)\r\n\r\n[/usr/local/lib/python3.9/dist-packages/matplotlib/axes/_axes.py](https://localhost:8080/#) in errorbar(self, x, y, yerr, xerr, fmt, ecolor, elinewidth, capsize, barsabove, lolims, uplims, xlolims, xuplims, errorevery, capthick, **kwargs)\r\n 3530 \r\n 3531 if xerr is not None and not isinstance(xerr, np.ndarray):\r\n-\u003e 3532 xerr = _upcast_err(xerr)\r\n 3533 if yerr is not None and not isinstance(yerr, np.ndarray):\r\n 3534 yerr = _upcast_err(yerr)\r\n\r\n[/usr/local/lib/python3.9/dist-packages/matplotlib/axes/_axes.py](https://localhost:8080/#) in _upcast_err(err)\r\n 3514 # location first on pandas objects so err[0] almost always\r\n 3515 # fails.\r\n-\u003e 3516 isinstance(cbook._safe_first_finite(err), np.ndarray)\r\n 3517 ):\r\n 3518 # Get the type of the first element\r\n\r\n[/usr/local/lib/python3.9/dist-packages/matplotlib/cbook/__init__.py](https://localhost:8080/#) in _safe_first_finite(obj, skip_nonfinite)\r\n 1713 \"support generators as input\")\r\n 1714 else:\r\n-\u003e 1715 return next(val for val in obj if safe_isfinite(val))\r\n 1716 \r\n 1717 \r\n\r\nStopIteration:\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n### Expected outcome\r\n\r\nPlot nothing\r\n\r\n### Additional information\r\n\r\n_No response_\r\n\r\n### Operating system\r\n\r\ncolab\r\n\r\n### Matplotlib Version\r\n\r\n3.7.1\r\n\r\n### Matplotlib Backend\r\n\r\n_No response_\r\n\r\n### Python version\r\n\r\n_No response_\r\n\r\n### Jupyter version\r\n\r\n_No response_\r\n\r\n### Installation\r\n\r\nNone","author":{"url":"https://github.com/Nanta-Sp","@type":"Person","name":"Nanta-Sp"},"datePublished":"2023-03-25T22:30:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/25549/matplotlib/issues/25549"}
| 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:52ef7cd4-8a56-3d08-c677-04750a6c7fb9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BE8A:1CFEED:DA5ABD:1213573:6A51B4F7 |
| html-safe-nonce | db8d9dd27358c4ff3fa211f443fdbc7d8cc14fdd2056b2d2206f1a8736d05d89 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRThBOjFDRkVFRDpEQTVBQkQ6MTIxMzU3Mzo2QTUxQjRGNyIsInZpc2l0b3JfaWQiOiIxMTE5MDcwNjUyOTI3Njg1ODc5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 68e22ef8de6615bcaf079f67fcc385c6ab4366982d2e9c058e8f4d161e088ec4 |
| hovercard-subject-tag | issue:1640685862 |
| 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/25549/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4406da6b3c5e9dc8425d4ceebe0d9a26c5a87ec51609f9a57434d8a76f908417/matplotlib/matplotlib/issues/25549 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4406da6b3c5e9dc8425d4ceebe0d9a26c5a87ec51609f9a57434d8a76f908417/matplotlib/matplotlib/issues/25549 |
| og:image:alt | Bug summary plt.errorbar don't give result when only nan data in the xerr or yerr. This is similar to issue #24127. Code for reproduction import numpy as np import matplotlib.pyplot as plt plt.erro... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Nanta-Sp |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width