René's URL Explorer Experiment


Title: Different result, slower runtime of heatmap between 2.0.0 and 2.0.1 · Issue #8947 · matplotlib/matplotlib · GitHub

Open Graph Title: Different result, slower runtime of heatmap between 2.0.0 and 2.0.1 · Issue #8947 · matplotlib/matplotlib

X Title: Different result, slower runtime of heatmap between 2.0.0 and 2.0.1 · Issue #8947 · matplotlib/matplotlib

Description: Bug report Bug summary I am using Matplotlib with Basemap to create heatmaps of data. A change introduced between version 2.0.0 and 2.0.1 caused my code to: Produce a different result Run significantly slower The problem still seems to e...

Open Graph Description: Bug report Bug summary I am using Matplotlib with Basemap to create heatmaps of data. A change introduced between version 2.0.0 and 2.0.1 caused my code to: Produce a different result Run significa...

X Description: Bug report Bug summary I am using Matplotlib with Basemap to create heatmaps of data. A change introduced between version 2.0.0 and 2.0.1 caused my code to: Produce a different result Run significa...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Different result, slower runtime of heatmap between 2.0.0 and 2.0.1","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\n\r\nI am using Matplotlib with Basemap to create heatmaps of data.\r\nA change introduced between version 2.0.0 and 2.0.1 caused my code to:\r\n* Produce a different result\r\n* Run significantly slower\r\n\r\nThe problem still seems to exist in 2.0.2.\r\n\r\nI also ran some profiling to have a look at the differences, and the increase in time seems to be in the `resample` function (from 0.473s total time to 19.042s total time)\r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nimport csv\r\nimport time\r\n\r\nimport numpy as np\r\nimport matplotlib\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.cm as cm\r\nfrom mpl_toolkits.basemap import Basemap\r\n\r\n\r\ndef create_basemap():\r\n    m = Basemap(projection='cyl', llcrnrlat=-90, urcrnrlat=90,\r\n                llcrnrlon=-180, urcrnrlon=180, resolution='c')\r\n    m.drawmapboundary(fill_color='#b4d0d0')\r\n    m.drawcoastlines(linewidth=0.25, color=\"#ffffff\")\r\n    m.fillcontinents(color=\"grey\", lake_color='#b4d0d0')\r\n\r\n    m.drawparallels(np.arange(-90., 91., 30.), linewidth=\"0.25\", color=\"#333333\")\r\n    m.drawmeridians(np.arange(-180., 181., 60.), linewidth=\"0.25\", color=\"#555555\")\r\n    return m\r\n\r\n\r\ndef create_heatmap(positions):\r\n    heatmap = np.zeros((180, 360))\r\n    extents = [[-90, 90], [-180, 180]]\r\n\r\n    lats, lons = map(list, zip(*positions))\r\n\r\n    subheatmap, xedges, yedges = np.histogram2d(lats, lons, bins=[180, 360], range=extents)\r\n    extent = [xedges[0], xedges[-1], yedges[0], yedges[-1]]\r\n    heatmap = np.add(heatmap, subheatmap)\r\n\r\n    fig = plt.figure()\r\n    m = create_basemap()\r\n\r\n    cmap = cm.jet\r\n    cmap.set_bad(alpha=0.0)\r\n\r\n    im = m.imshow(heatmap, cmap=cmap, interpolation='bicubic', extent=extent, origin='lower', alpha=1.0, norm=matplotlib.colors.LogNorm(), vmin=1, vmax=2, zorder=100)\r\n    cb = fig.colorbar(im, shrink=0.5, format=\"%d\")\r\n\r\n    plt.title(\"Test\")\r\n    plt.savefig(\"test.png\", dpi=500, bbox_inches='tight', pad_inches=0.1)\r\n    plt.close()\r\n\r\n\r\npositions = [(50, i) for i in range(50)]\r\nstart = time.time()\r\ncreate_heatmap(positions)\r\nprint \"Runtime: {0}\".format(time.time() - start)\r\n```\r\n\r\n**Version 2.0.0 outcome**\r\n\r\n```\r\nRuntime: 2.31200003624\r\n```\r\n![2 0 0](https://user-images.githubusercontent.com/8438951/28690404-0c940b66-72e7-11e7-8589-de72d04283e2.png)\r\n\r\n`python -m cProfile --sort=tottime script.py`:\r\n```\r\n         667764 function calls (659117 primitive calls) in 3.555 seconds\r\n\r\n   Ordered by: internal time\r\n\r\n   ncalls  tottime  percall  cumtime  percall filename:lineno(function)\r\n        2    0.702    0.351    0.702    0.351 {matplotlib._png.write_png}\r\n        2    0.473    0.237    0.473    0.237 {matplotlib._image.resample}\r\n        1    0.138    0.138    0.138    0.138 {_tkinter.create}\r\n      890    0.117    0.000    0.117    0.000 {method 'is_valid' of '_geoslib.BaseGeometry' objects}\r\n       15    0.106    0.007    0.632    0.042 __init__.py:1(\u003cmodule\u003e)\r\n        1    0.090    0.090    0.135    0.135 __init__.py:14(\u003cmodule\u003e)\r\n      296    0.083    0.000    0.083    0.000 {method 'intersection' of '_geoslib.BaseGeometry' objects}\r\n        2    0.068    0.034    0.681    0.340 image.py:275(_make_image)\r\n    11413    0.055    0.000    0.058    0.000 {numpy.core.multiarray.array}\r\n      300    0.050    0.000    0.072    0.000 {method 'draw_path' of 'matplotlib.backends._backend_agg.RendererAgg' objects}\r\n...\r\n```\r\n\r\n**Version 2.0.1 outcome**\r\n```\r\nRuntime: 21.0169999599\r\n```\r\n![2 0 1](https://user-images.githubusercontent.com/8438951/28690462-4f7640a2-72e7-11e7-8688-4d9f7c729cf3.png)\r\n\r\n`python -m cProfile --sort=tottime script.py`:\r\n```\r\n         1763720 function calls (1754827 primitive calls) in 23.725 seconds\r\n\r\n   Ordered by: internal time\r\n\r\n   ncalls  tottime  percall  cumtime  percall filename:lineno(function)\r\n        4   19.042    4.761   19.043    4.761 {matplotlib._image.resample}\r\n        2    0.735    0.367    0.735    0.367 {matplotlib._png.write_png}\r\n        2    0.609    0.304    1.377    0.688 font_manager.py:558(createFontList)\r\n       60    0.138    0.002    0.336    0.006 afm.py:181(_parse_char_metrics)\r\n        1    0.135    0.135    0.135    0.135 {_tkinter.create}\r\n        2    0.133    0.067   19.309    9.655 image.py:275(_make_image)\r\n      890    0.115    0.000    0.115    0.000 {method 'is_valid' of '_geoslib.BaseGeometry' objects}\r\n        1    0.107    0.107    0.159    0.159 __init__.py:14(\u003cmodule\u003e)\r\n       15    0.106    0.007    0.637    0.042 __init__.py:1(\u003cmodule\u003e)\r\n      559    0.104    0.000    0.104    0.000 {method 'get_sfnt' of 'matplotlib.ft2font.FT2Font' objects}\r\n```\r\n\r\n**Matplotlib version**\r\n  * Operating System: Windows 10\r\n  * Matplotlib Version: 2.0.0/2.0.1 (from pip)\r\n  * Python Version: 2.7.13\r\n  * Jupyter Version (if applicable): N/A\r\n  * Other Libraries: basemap 1.1.0, numpy 1.13.1\r\n\r\n","author":{"url":"https://github.com/NickG123","@type":"Person","name":"NickG123"},"datePublished":"2017-07-27T20:31:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/8947/matplotlib/issues/8947"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:80e25168-066a-1a3d-0940-54859ce8bc2b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id81AC:221685:255C025:31FE699:6A52127F
html-safe-nonceaa73a48f8de9d8d633145ee5e666edec2e5a259bfe2756acf63fcae31343974e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MUFDOjIyMTY4NToyNTVDMDI1OjMxRkU2OTk6NkE1MjEyN0YiLCJ2aXNpdG9yX2lkIjoiNTQ4NzQ4MTk4NDE3ODU5MDMzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacde081f0126cd6caaec705c23e088d39e5c1bb090d53b67f92346f9d5c35c7e8b
hovercard-subject-tagissue:246160222
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/8947/issue_layout
twitter:imagehttps://opengraph.githubassets.com/32dea35ae01e156238022ab08022af5fd112525bbe2440378ecfc47786e0cf95/matplotlib/matplotlib/issues/8947
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/32dea35ae01e156238022ab08022af5fd112525bbe2440378ecfc47786e0cf95/matplotlib/matplotlib/issues/8947
og:image:altBug report Bug summary I am using Matplotlib with Basemap to create heatmaps of data. A change introduced between version 2.0.0 and 2.0.1 caused my code to: Produce a different result Run significa...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameNickG123
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
release7aed05249554b889eb33d002851a973eebcc7e91
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/issues/8947#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F8947
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%2F8947
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/8947
Reloadhttps://github.com/matplotlib/matplotlib/issues/8947
Reloadhttps://github.com/matplotlib/matplotlib/issues/8947
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/8947
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/8947
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
Different result, slower runtime of heatmap between 2.0.0 and 2.0.1https://github.com/matplotlib/matplotlib/issues/8947#top
https://github.com/tacaswell
v3.1.0https://github.com/matplotlib/matplotlib/milestone/35
https://github.com/NickG123
NickG123https://github.com/NickG123
on Jul 27, 2017https://github.com/matplotlib/matplotlib/issues/8947#issue-246160222
https://user-images.githubusercontent.com/8438951/28690404-0c940b66-72e7-11e7-8589-de72d04283e2.png
https://user-images.githubusercontent.com/8438951/28690462-4f7640a2-72e7-11e7-8688-4d9f7c729cf3.png
tacaswellhttps://github.com/tacaswell
v3.1.0https://github.com/matplotlib/matplotlib/milestone/35
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.