René's URL Explorer Experiment


Title: creating PathCollection proxy artist with %matplotlib inline raises ValueError: cannot convert float NaN to integer · Issue #10360 · matplotlib/matplotlib · GitHub

Open Graph Title: creating PathCollection proxy artist with %matplotlib inline raises ValueError: cannot convert float NaN to integer · Issue #10360 · matplotlib/matplotlib

X Title: creating PathCollection proxy artist with %matplotlib inline raises ValueError: cannot convert float NaN to integer · Issue #10360 · matplotlib/matplotlib

Description: First, I'm not sure if this is a matplotlibor a jupyter bug, so I apologize if I'm posting at the wrong place. I'm having some problems with some code that used to work in a previous version of maptlotlib+jupyter notebook. I managed to t...

Open Graph Description: First, I'm not sure if this is a matplotlibor a jupyter bug, so I apologize if I'm posting at the wrong place. I'm having some problems with some code that used to work in a previous version of map...

X Description: First, I'm not sure if this is a matplotlibor a jupyter bug, so I apologize if I'm posting at the wrong place. I'm having some problems with some code that used to work in a previous ve...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"creating PathCollection proxy artist with %matplotlib inline raises ValueError: cannot convert float NaN to integer","articleBody":"First, I'm not sure if this is a `matplotlib`or a `jupyter` bug, so I apologize if I'm posting at the wrong place.\r\n\r\nI'm having some problems with some code that used to work in a previous version of maptlotlib+jupyter notebook.\r\nI managed to trace the problem to creating an empty PathCollection to be used as a legend proxy artist, but the Exception is only raised when using the `inline` backend (`%matplotlib inline`). The code works fine using `%matplotlib notebook` or in ipython using the `MacOSX` backend\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\n\u003c!--A short 1-2 sentences that succinctly describes the bug--\u003e\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\n%matplotlib inline\r\nfrom matplotlib import pyplot as plt\r\n_, ax = plt.subplots()\r\na = ax.scatter([], [], clip_on=False,\r\n                 marker='s', s=20, facecolor='k', \r\n                 edgecolors='r', linewidths=5, \r\n                 zorder=100, label='label')\r\nax.legend(handles=[a])\r\n\r\nplt.show()\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\u003c!--The output produced by the above code, which may be a screenshot, console output, etc.--\u003e\r\n\r\n```\r\nValueError                                Traceback (most recent call last)\r\n~/anaconda3/lib/python3.6/site-packages/IPython/core/formatters.py in __call__(self, obj)\r\n    339                 pass\r\n    340             else:\r\n--\u003e 341                 return printer(obj)\r\n    342             # Finally look for special method names\r\n    343             method = get_real_method(obj, self.print_method)\r\n\r\n~/anaconda3/lib/python3.6/site-packages/IPython/core/pylabtools.py in \u003clambda\u003e(fig)\r\n    236 \r\n    237     if 'png' in formats:\r\n--\u003e 238         png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs))\r\n    239     if 'retina' in formats or 'png2x' in formats:\r\n    240         png_formatter.for_type(Figure, lambda fig: retina_figure(fig, **kwargs))\r\n\r\n~/anaconda3/lib/python3.6/site-packages/IPython/core/pylabtools.py in print_figure(fig, fmt, bbox_inches, **kwargs)\r\n    120 \r\n    121     bytes_io = BytesIO()\r\n--\u003e 122     fig.canvas.print_figure(bytes_io, **kw)\r\n    123     data = bytes_io.getvalue()\r\n    124     if fmt == 'svg':\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, **kwargs)\r\n   2265                 orientation=orientation,\r\n   2266                 bbox_inches_restore=_bbox_inches_restore,\r\n-\u003e 2267                 **kwargs)\r\n   2268         finally:\r\n   2269             if bbox_inches and restore_bbox:\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py in print_png(self, filename_or_obj, *args, **kwargs)\r\n    505 \r\n    506     def print_png(self, filename_or_obj, *args, **kwargs):\r\n--\u003e 507         FigureCanvasAgg.draw(self)\r\n    508         renderer = self.get_renderer()\r\n    509         original_dpi = renderer.dpi\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py in draw(self)\r\n    428             # if toolbar:\r\n    429             #     toolbar.set_cursor(cursors.WAIT)\r\n--\u003e 430             self.figure.draw(self.renderer)\r\n    431         finally:\r\n    432             # if toolbar:\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)\r\n     53                 renderer.start_filter()\r\n     54 \r\n---\u003e 55             return draw(artist, renderer, *args, **kwargs)\r\n     56         finally:\r\n     57             if artist.get_agg_filter() is not None:\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/figure.py in draw(self, renderer)\r\n   1297 \r\n   1298             mimage._draw_list_compositing_images(\r\n-\u003e 1299                 renderer, self, artists, self.suppressComposite)\r\n   1300 \r\n   1301             renderer.close_group('figure')\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/image.py in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)\r\n    136     if not_composite or not has_images:\r\n    137         for a in artists:\r\n--\u003e 138             a.draw(renderer)\r\n    139     else:\r\n    140         # Composite any adjacent images together\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)\r\n     53                 renderer.start_filter()\r\n     54 \r\n---\u003e 55             return draw(artist, renderer, *args, **kwargs)\r\n     56         finally:\r\n     57             if artist.get_agg_filter() is not None:\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_base.py in draw(self, renderer, inframe)\r\n   2435             renderer.stop_rasterizing()\r\n   2436 \r\n-\u003e 2437         mimage._draw_list_compositing_images(renderer, self, artists)\r\n   2438 \r\n   2439         renderer.close_group('axes')\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/image.py in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)\r\n    136     if not_composite or not has_images:\r\n    137         for a in artists:\r\n--\u003e 138             a.draw(renderer)\r\n    139     else:\r\n    140         # Composite any adjacent images together\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)\r\n     53                 renderer.start_filter()\r\n     54 \r\n---\u003e 55             return draw(artist, renderer, *args, **kwargs)\r\n     56         finally:\r\n     57             if artist.get_agg_filter() is not None:\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/axis.py in draw(self, renderer, *args, **kwargs)\r\n   1131         renderer.open_group(__name__)\r\n   1132 \r\n-\u003e 1133         ticks_to_draw = self._update_ticks(renderer)\r\n   1134         ticklabelBoxes, ticklabelBoxes2 = self._get_tick_bboxes(ticks_to_draw,\r\n   1135                                                                 renderer)\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/axis.py in _update_ticks(self, renderer)\r\n    972 \r\n    973         interval = self.get_view_interval()\r\n--\u003e 974         tick_tups = list(self.iter_ticks())\r\n    975         if self._smart_bounds and tick_tups:\r\n    976             # handle inverted limits\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/axis.py in iter_ticks(self)\r\n    915         Iterate through all of the major and minor ticks.\r\n    916         \"\"\"\r\n--\u003e 917         majorLocs = self.major.locator()\r\n    918         majorTicks = self.get_major_ticks(len(majorLocs))\r\n    919         self.major.formatter.set_locs(majorLocs)\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/ticker.py in __call__(self)\r\n   1951     def __call__(self):\r\n   1952         vmin, vmax = self.axis.get_view_interval()\r\n-\u003e 1953         return self.tick_values(vmin, vmax)\r\n   1954 \r\n   1955     def tick_values(self, vmin, vmax):\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/ticker.py in tick_values(self, vmin, vmax)\r\n   1959         vmin, vmax = mtransforms.nonsingular(\r\n   1960             vmin, vmax, expander=1e-13, tiny=1e-14)\r\n-\u003e 1961         locs = self._raw_ticks(vmin, vmax)\r\n   1962 \r\n   1963         prune = self._prune\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/ticker.py in _raw_ticks(self, vmin, vmax)\r\n   1901         if self._nbins == 'auto':\r\n   1902             if self.axis is not None:\r\n-\u003e 1903                 nbins = np.clip(self.axis.get_tick_space(),\r\n   1904                                 max(1, self._min_n_ticks - 1), 9)\r\n   1905             else:\r\n\r\n~/anaconda3/lib/python3.6/site-packages/matplotlib/axis.py in get_tick_space(self)\r\n   2060         size = tick.label1.get_size() * 3\r\n   2061         if size \u003e 0:\r\n-\u003e 2062             return int(np.floor(length / size))\r\n   2063         else:\r\n   2064             return 2**31 - 1\r\n\r\nValueError: cannot convert float NaN to integer\r\n```\r\n\r\n**Expected outcome**\r\n\r\nThe exact same code using %matplotlib notebook\r\n```python\r\n%matplotlib notebook\r\nfrom matplotlib import pyplot as plt\r\n_, ax = plt.subplots()\r\na = ax.scatter([], [], clip_on=False,\r\n                 marker='s', s=20, facecolor='k', \r\n                 edgecolors='r', linewidths=5, \r\n                 zorder=100, label='label')\r\nax.legend(handles=[a])\r\n\r\nplt.show()\r\n```\r\nproduces the expected output\r\n![download](https://user-images.githubusercontent.com/13396853/35683348-ef976316-0763-11e8-8b2d-2d9a8bf32cfd.png)\r\n\r\nThe code using %matplotlib inline used to work before, but unfortunately, I don't know which version of matplotlib/jupyter I was using\r\n\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: OSX\r\n  * Matplotlib version: 2.1.2\r\n  * Matplotlib backend (`print(matplotlib.get_backend())`): module://ipykernel.pylab.backend_inline\r\n  * Python version: Python 3.6.4 |Anaconda custom (64-bit)\r\n  * Jupyter version (if applicable): `The version of the notebook server is: 5.3.1`\r\n  * Other libraries: \r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\n\r\n","author":{"url":"https://github.com/DizietAsahi","@type":"Person","name":"DizietAsahi"},"datePublished":"2018-02-01T14:27:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/10360/matplotlib/issues/10360"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a4c98a69-2c15-b457-b0b5-29676d3fd795
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD9E0:2D857A:31C14E0:44047BA:6A53EBA8
html-safe-nonce61995ab29e4af027c3fb3650d91de1e68746a5ad9b3cf5aa5f4eee7e5078480b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOUUwOjJEODU3QTozMUMxNEUwOjQ0MDQ3QkE6NkE1M0VCQTgiLCJ2aXNpdG9yX2lkIjoiMzkyMTgxNTMzMzYwNzA0MTk2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac3af9b0d3fe64c549a9f2a91f7bbabed43ed04fa1154efdea39aa7e5e7f463e02
hovercard-subject-tagissue:293549855
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/10360/issue_layout
twitter:imagehttps://opengraph.githubassets.com/bd7ae0ee36238e2b21e02991dc236c4a86216d51b8c08596725d64d5626204ad/matplotlib/matplotlib/issues/10360
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/bd7ae0ee36238e2b21e02991dc236c4a86216d51b8c08596725d64d5626204ad/matplotlib/matplotlib/issues/10360
og:image:altFirst, I'm not sure if this is a matplotlibor a jupyter bug, so I apologize if I'm posting at the wrong place. I'm having some problems with some code that used to work in a previous version of map...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameDizietAsahi
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
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/issues/10360#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F10360
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%2F10360
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/10360
Reloadhttps://github.com/matplotlib/matplotlib/issues/10360
Reloadhttps://github.com/matplotlib/matplotlib/issues/10360
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/10360
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/10360
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
creating PathCollection proxy artist with %matplotlib inline raises ValueError: cannot convert float NaN to integerhttps://github.com/matplotlib/matplotlib/issues/10360#top
v3.0.3https://github.com/matplotlib/matplotlib/milestone/40
https://github.com/DizietAsahi
DizietAsahihttps://github.com/DizietAsahi
on Feb 1, 2018https://github.com/matplotlib/matplotlib/issues/10360#issue-293549855
https://user-images.githubusercontent.com/13396853/35683348-ef976316-0763-11e8-8b2d-2d9a8bf32cfd.png
v3.0.3https://github.com/matplotlib/matplotlib/milestone/40
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.