René's URL Explorer Experiment


Title: `_axes.py.scatter()` array index out of bound / calling from `seaborn` · Issue #12641 · matplotlib/matplotlib · GitHub

Open Graph Title: `_axes.py.scatter()` array index out of bound / calling from `seaborn` · Issue #12641 · matplotlib/matplotlib

X Title: `_axes.py.scatter()` array index out of bound / calling from `seaborn` · Issue #12641 · matplotlib/matplotlib

Description: Bug report Bug summary Seeing this with matplotlib 3.0.1 and seaborn 0.9. cc @mwaskom matplotlib.axes._axes.scatter() tests parameter c hits array index out of bound when c is an empty array. I encountered this while using seaborn.swarmp...

Open Graph Description: Bug report Bug summary Seeing this with matplotlib 3.0.1 and seaborn 0.9. cc @mwaskom matplotlib.axes._axes.scatter() tests parameter c hits array index out of bound when c is an empty array. I enc...

X Description: Bug report Bug summary Seeing this with matplotlib 3.0.1 and seaborn 0.9. cc @mwaskom matplotlib.axes._axes.scatter() tests parameter c hits array index out of bound when c is an empty array. I enc...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`_axes.py.scatter()` array index out of bound / calling from `seaborn`","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\n\r\nSeeing this with `matplotlib 3.0.1` and `seaborn 0.9`. cc @mwaskom\r\n \r\n[matplotlib.axes._axes.scatter()](https://github.com/matplotlib/matplotlib/blob/921d4f4ab7ae2eb0feda02a364e8d63c6b6709c5/lib/matplotlib/axes/_axes.py#L4192) tests parameter `c` hits `array index out of bound` when `c` is an empty array. \r\n\r\nI encountered this while using `seaborn.swarmplot()` with `hue=` parameter. Essentially this plots each group (`hue`, in addition to x-axis category) and some times a group can be empty for a major x-axis category. \r\n\r\nSuggest potential fix to test length of `c` as well before accessing `c[0]`. \r\n\r\n```\r\n        if (c_none or\r\n                co is not None or\r\n                isinstance(c, str) or\r\n                (isinstance(c, collections.Iterable) and \r\n                    len(c) \u003e 0 and # proposed fix here\r\n                    isinstance(c[0], str))):\r\n```\r\n\r\n**Code for reproduction**\r\n\r\n\u003c!--A minimum code snippet required to reproduce the bug, also minimizing the number of dependencies required--\u003e\r\n\r\n```python\r\nimport pandas as pd\r\nimport seaborn as sns\r\n\r\ndf = pd.DataFrame(dict(category=['a', 'a', 'b', 'b', 'c'],\r\n                       hue=['x', 'y', 'x', 'y', 'x'],\r\n                       values=[1, 2, 3, 4, 3]))\r\nsns.swarmplot('category', 'values', hue='hue', data=df, dodge=True)\r\n```\r\n\r\n**Actual outcome**\r\n\r\nThis is the error I see:\r\n\r\n```\r\nIndexError                                Traceback (most recent call last)\r\n\u003cipython-input-5-0368a082f6a8\u003e in \u003cmodule\u003e\r\n----\u003e 1 sns.swarmplot('category', 'values', hue='hue', data=df, dodge=True)\r\n\r\nh:\\anaconda3\\lib\\site-packages\\seaborn\\categorical.py in swarmplot(x, y, hue, data, order, hue_order, dodge, orient, color, palette, size, edgecolor, linewidth, ax, **kwargs)\r\n   2989                        linewidth=linewidth))\r\n   2990 \r\n-\u003e 2991     plotter.plot(ax, kwargs)\r\n   2992     return ax\r\n   2993 \r\n\r\nh:\\anaconda3\\lib\\site-packages\\seaborn\\categorical.py in plot(self, ax, kws)\r\n   1444     def plot(self, ax, kws):\r\n   1445         \"\"\"Make the full plot.\"\"\"\r\n-\u003e 1446         self.draw_swarmplot(ax, kws)\r\n   1447         self.add_legend_data(ax)\r\n   1448         self.annotate_axes(ax)\r\n\r\nh:\\anaconda3\\lib\\site-packages\\seaborn\\categorical.py in draw_swarmplot(self, ax, kws)\r\n   1429                     kws.update(c=point_colors)\r\n   1430                     if self.orient == \"v\":\r\n-\u003e 1431                         points = ax.scatter(cat_pos, swarm_data, s=s, **kws)\r\n   1432                     else:\r\n   1433                         points = ax.scatter(swarm_data, cat_pos, s=s, **kws)\r\n\r\nh:\\anaconda3\\lib\\site-packages\\matplotlib\\__init__.py in inner(ax, data, *args, **kwargs)\r\n   1803                         \"the Matplotlib list!)\" % (label_namer, func.__name__),\r\n   1804                         RuntimeWarning, stacklevel=2)\r\n-\u003e 1805             return func(ax, *args, **kwargs)\r\n   1806 \r\n   1807         inner.__doc__ = _add_data_doc(inner.__doc__,\r\n\r\nh:\\anaconda3\\lib\\site-packages\\matplotlib\\axes\\_axes.py in scatter(self, x, y, s, c, marker, cmap, norm, vmin, vmax, alpha, linewidths, verts, edgecolors, **kwargs)\r\n   4194                 (isinstance(c, collections.Iterable) and\r\n   4195                     # len(c) \u003e 0 and\r\n-\u003e 4196                     isinstance(c[0], str))):\r\n   4197             c_array = None\r\n   4198         else:\r\n\r\nIndexError: index 0 is out of bounds for axis 0 with size 0\r\n```\r\n\r\nHappy to create a PR if we have happy with the proposed length test.\r\n","author":{"url":"https://github.com/esvhd","@type":"Person","name":"esvhd"},"datePublished":"2018-10-26T12:44:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":28},"url":"https://github.com/12641/matplotlib/issues/12641"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d29bf6b9-be2f-aa3d-700c-5dd52caf8e73
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDCEA:2BB05E:3F2E71:5A86E9:6A5485DD
html-safe-nonceb32a831e2a729851a4b72b3a8cc514db3b4d647f59fd14a06383199767cbb6f0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQ0VBOjJCQjA1RTozRjJFNzE6NUE4NkU5OjZBNTQ4NUREIiwidmlzaXRvcl9pZCI6IjE0ODUxODE5Mjg3NTU5ODc5MzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac1332ff2c14ba737b1a6333ae05419df7689bc83738bdf5ac0e0289cf026dc704
hovercard-subject-tagissue:374367401
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/12641/issue_layout
twitter:imagehttps://opengraph.githubassets.com/da419dfe52a58475bd1cadb2d00295060c4f0f14d9cda0edcdb3db2a12ab2eec/matplotlib/matplotlib/issues/12641
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/da419dfe52a58475bd1cadb2d00295060c4f0f14d9cda0edcdb3db2a12ab2eec/matplotlib/matplotlib/issues/12641
og:image:altBug report Bug summary Seeing this with matplotlib 3.0.1 and seaborn 0.9. cc @mwaskom matplotlib.axes._axes.scatter() tests parameter c hits array index out of bound when c is an empty array. I enc...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameesvhd
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
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
release03ccb116376fd46e8ba2a4cdc541e35f13f70734
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/issues/12641#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F12641
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%2F12641
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/issues/12641
Reloadhttps://github.com/matplotlib/matplotlib/issues/12641
Reloadhttps://github.com/matplotlib/matplotlib/issues/12641
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/12641
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/12641
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 408 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
_axes.py.scatter() array index out of bound / calling from seabornhttps://github.com/matplotlib/matplotlib/issues/12641#top
v3.0.2https://github.com/matplotlib/matplotlib/milestone/39
https://github.com/esvhd
esvhdhttps://github.com/esvhd
on Oct 26, 2018https://github.com/matplotlib/matplotlib/issues/12641#issue-374367401
@mwaskomhttps://github.com/mwaskom
matplotlib.axes._axes.scatter()https://github.com/matplotlib/matplotlib/blob/921d4f4ab7ae2eb0feda02a364e8d63c6b6709c5/lib/matplotlib/axes/_axes.py#L4192
v3.0.2https://github.com/matplotlib/matplotlib/milestone/39
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.