René's URL Explorer Experiment


Title: Issue · GitHub

Open Graph Title: Issue · matplotlib/matplotlib

X Title: Issue · matplotlib/matplotlib

Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.

Open Graph Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.

X Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.

Opengraph URL: https://github.com/matplotlib/matplotlib

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"UserWarning thrown when all values are \"bad\", but not when only some are","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\nIf all values passed as colors are \"bad\" (`np.nan`), a warning is thrown from numpy about converting masked values to null. If some of the values are \"bad\", this does not happen.\r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nimport numpy as np, matplotlib.pyplot as plt\r\n```\r\n\r\nThis does not warn:\r\n\r\n```python\r\nc = np.full(10, np.nan)\r\nc[0] = 1.\r\nplt.scatter(np.ones(10), np.ones(10), c=c)\r\nplt.show()\r\n```\r\n\r\nThis does:\r\n\r\n```python\r\nplt.scatter(np.ones(10), np.ones(10), c=np.full(10, np.nan))\r\nplt.show()\r\n```\r\n\r\n```pytb\r\n\u003c__array_function__ internals\u003e:5: UserWarning: Warning: converting a masked element to nan.\r\n/usr/local/lib/python3.8/site-packages/numpy/core/_asarray.py:85: UserWarning: Warning: converting a masked element to nan.\r\n  return array(a, dtype, copy=False, order=order)\r\n```\r\n\r\nThis is difficult to hide since since the warning is not thrown when the figure is being constructed, but when it is shown. Here's a full traceback to show this:\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e Full traceback \u003c/summary\u003e\r\n\r\n```pytb\r\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/pyplot.py\", line 337, in show\r\n    return _backend_mod.show(*args, **kwargs)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/backend_bases.py\", line 3544, in show\r\n    cls.mainloop()\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/backends/backend_macosx.py\", line 171, in mainloop\r\n    _macosx.show()\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/backends/backend_macosx.py\", line 61, in _draw\r\n    self.figure.draw(renderer)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/artist.py\", line 41, in draw_wrapper\r\n    return draw(artist, renderer, *args, **kwargs)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/figure.py\", line 1863, in draw\r\n    mimage._draw_list_compositing_images(\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/image.py\", line 131, in _draw_list_compositing_images\r\n    a.draw(renderer)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/artist.py\", line 41, in draw_wrapper\r\n    return draw(artist, renderer, *args, **kwargs)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/cbook/deprecation.py\", line 411, in wrapper\r\n    return func(*inner_args, **inner_kwargs)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/axes/_base.py\", line 2748, in draw\r\n    mimage._draw_list_compositing_images(renderer, self, artists)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/image.py\", line 131, in _draw_list_compositing_images\r\n    a.draw(renderer)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/artist.py\", line 41, in draw_wrapper\r\n    return draw(artist, renderer, *args, **kwargs)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/collections.py\", line 931, in draw\r\n    Collection.draw(self, renderer)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/artist.py\", line 41, in draw_wrapper\r\n    return draw(artist, renderer, *args, **kwargs)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/collections.py\", line 346, in draw\r\n    self.update_scalarmappable()\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/collections.py\", line 855, in update_scalarmappable\r\n    self._facecolors = self.to_rgba(self._A, self._alpha)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/cm.py\", line 332, in to_rgba\r\n    x = self.norm(x)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/colors.py\", line 1048, in __call__\r\n    (vmin,), _ = self.process_value(self.vmin)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/colors.py\", line 1012, in process_value\r\n    dtype = np.min_scalar_type(value)\r\n  File \"\u003c__array_function__ internals\u003e\", line 5, in min_scalar_type\r\n  File \"/usr/local/lib/python3.8/site-packages/numpy/ma/core.py\", line 4331, in __float__\r\n    warnings.warn(\"Warning: converting a masked element to nan.\", stacklevel=2)\r\n  File \"/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/warnings.py\", line 109, in _showwarnmsg\r\n    sw(msg.message, msg.category, msg.filename, msg.lineno,\r\n  File \"\u003cstdin\u003e\", line 3, in warn_with_traceback\r\n\u003c__array_function__ internals\u003e:5: UserWarning: Warning: converting a masked element to nan.\r\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/pyplot.py\", line 337, in show\r\n    return _backend_mod.show(*args, **kwargs)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/backend_bases.py\", line 3544, in show\r\n    cls.mainloop()\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/backends/backend_macosx.py\", line 171, in mainloop\r\n    _macosx.show()\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/backends/backend_macosx.py\", line 61, in _draw\r\n    self.figure.draw(renderer)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/artist.py\", line 41, in draw_wrapper\r\n    return draw(artist, renderer, *args, **kwargs)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/figure.py\", line 1863, in draw\r\n    mimage._draw_list_compositing_images(\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/image.py\", line 131, in _draw_list_compositing_images\r\n    a.draw(renderer)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/artist.py\", line 41, in draw_wrapper\r\n    return draw(artist, renderer, *args, **kwargs)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/cbook/deprecation.py\", line 411, in wrapper\r\n    return func(*inner_args, **inner_kwargs)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/axes/_base.py\", line 2748, in draw\r\n    mimage._draw_list_compositing_images(renderer, self, artists)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/image.py\", line 131, in _draw_list_compositing_images\r\n    a.draw(renderer)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/artist.py\", line 41, in draw_wrapper\r\n    return draw(artist, renderer, *args, **kwargs)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/collections.py\", line 931, in draw\r\n    Collection.draw(self, renderer)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/artist.py\", line 41, in draw_wrapper\r\n    return draw(artist, renderer, *args, **kwargs)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/collections.py\", line 346, in draw\r\n    self.update_scalarmappable()\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/collections.py\", line 855, in update_scalarmappable\r\n    self._facecolors = self.to_rgba(self._A, self._alpha)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/cm.py\", line 332, in to_rgba\r\n    x = self.norm(x)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/colors.py\", line 1048, in __call__\r\n    (vmin,), _ = self.process_value(self.vmin)\r\n  File \"/usr/local/lib/python3.8/site-packages/matplotlib/colors.py\", line 1019, in process_value\r\n    data = np.asarray(value)\r\n  File \"/usr/local/lib/python3.8/site-packages/numpy/core/_asarray.py\", line 85, in asarray\r\n    return array(a, dtype, copy=False, order=order)\r\n  File \"/usr/local/lib/python3.8/site-packages/numpy/ma/core.py\", line 4331, in __float__\r\n    warnings.warn(\"Warning: converting a masked element to nan.\", stacklevel=2)\r\n  File \"/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/warnings.py\", line 109, in _showwarnmsg\r\n    sw(msg.message, msg.category, msg.filename, msg.lineno,\r\n  File \"\u003cstdin\u003e\", line 3, in warn_with_traceback\r\n/usr/local/lib/python3.8/site-packages/numpy/core/_asarray.py:85: UserWarning: Warning: converting a masked element to nan.\r\n  return array(a, dtype, copy=False, order=order)\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n**Expected outcome**\r\n\r\nI wouldn't expect the second to warn if the first doesn't.\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: macOS\r\n  * Matplotlib version: 3.3.1\r\n  * Matplotlib backend (`print(matplotlib.get_backend())`): MacOSX and module://ipykernel.pylab.backend_inline\r\n  * Python version: 3.8.5\r\n  * Jupyter version (if applicable): Replicates in python repl, but also was happening in ipython and jupyter lab\r\n  * Other libraries: \r\n\r\nInstalled with pip","author":{"url":"https://github.com/ivirshup","@type":"Person","name":"ivirshup"},"datePublished":"2020-08-19T06:07:26.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/18294/matplotlib/issues/18294"}

route-pattern/:user_id/:repository/issues/:id(.:format)
route-controllerissues
route-actionshow
fetch-noncev2:655965fc-2eb3-d7e3-c7bd-ae29b5d3cf21
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDEE0:1C80C7:533162:72CB9B:6A51234F
html-safe-noncedbf56a19c62d18d747ea26fe6e1337b83a37b3935dff683a34a8996efd1ce1c5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERUUwOjFDODBDNzo1MzMxNjI6NzJDQjlCOjZBNTEyMzRGIiwidmlzaXRvcl9pZCI6Ijg4OTc1NjA4NDQ2NzU2NTQ0NzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaccb65a49835dd82c0b2a6980a80dbff2f4d2634edc182c472849611df6e1461a9
hovercard-subject-tagrepository:1385122
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///issues/show
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/matplotlib/matplotlib/issues/18294
twitter:imagehttps://opengraph.githubassets.com/71df57b45279fb48f14f38101838216990f40b6e663ac9ba1a234f023245d9b5/matplotlib/matplotlib
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/71df57b45279fb48f14f38101838216990f40b6e663ac9ba1a234f023245d9b5/matplotlib/matplotlib
og:image:altmatplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None689b683944b0d7f015d0e776452c970832fa81b82dc15284469b556ecced715b
turbo-cache-controlno-cache
go-importgithub.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git
octolytics-dimension-user_id215947
octolytics-dimension-user_loginmatplotlib
octolytics-dimension-repository_id1385122
octolytics-dimension-repository_nwomatplotlib/matplotlib
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1385122
octolytics-dimension-repository_network_root_nwomatplotlib/matplotlib
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release942b51ed3bd5feee3d5e2719f890a5fe286edbbb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/issues/18294#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F18294
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F18294
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fissues%2Fshow&source=header-repo&source_repo=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/issues/18294
Reloadhttps://github.com/matplotlib/matplotlib/issues/18294
Reloadhttps://github.com/matplotlib/matplotlib/issues/18294
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/18294
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/18294
Notifications https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Fork 8.4k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Star 23k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Code https://github.com/matplotlib/matplotlib
Issues 1.1k https://github.com/matplotlib/matplotlib/issues
Pull requests 409 https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality 0 https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Code https://github.com/matplotlib/matplotlib
Issues https://github.com/matplotlib/matplotlib/issues
Pull requests https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
#25547https://github.com/matplotlib/matplotlib/pull/25547
UserWarning thrown when all values are "bad", but not when only some arehttps://github.com/matplotlib/matplotlib/issues/18294#top
#25547https://github.com/matplotlib/matplotlib/pull/25547
v3.7.2https://github.com/matplotlib/matplotlib/milestone/81
https://github.com/ivirshup
ivirshuphttps://github.com/ivirshup
on Aug 19, 2020https://github.com/matplotlib/matplotlib/issues/18294#issue-681574037
v3.7.2https://github.com/matplotlib/matplotlib/milestone/81
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.