René's URL Explorer Experiment


Title: Doc: MidpointNormalize example should point to DivergingNorm as a built-in function · Issue #14892 · matplotlib/matplotlib · GitHub

Open Graph Title: Doc: MidpointNormalize example should point to DivergingNorm as a built-in function · Issue #14892 · matplotlib/matplotlib

X Title: Doc: MidpointNormalize example should point to DivergingNorm as a built-in function · Issue #14892 · matplotlib/matplotlib

Description: I've seen many folks seeking a way to set 0 as the midpoint in a color bar. I wonder if this MidpointNormalize subclass could be added into matplotlib as a builtin function. The following code is copied from the doc. import numpy as np i...

Open Graph Description: I've seen many folks seeking a way to set 0 as the midpoint in a color bar. I wonder if this MidpointNormalize subclass could be added into matplotlib as a builtin function. The following code is c...

X Description: I've seen many folks seeking a way to set 0 as the midpoint in a color bar. I wonder if this MidpointNormalize subclass could be added into matplotlib as a builtin function. The following code ...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Doc: MidpointNormalize example should point to DivergingNorm as a built-in function","articleBody":"I've seen many folks seeking a way to set 0 as the midpoint in a color bar. I wonder if this `MidpointNormalize` subclass could be added into matplotlib as a builtin function.\r\n\r\nThe following code is copied from the [doc](https://matplotlib.org/3.1.1/gallery/userdemo/colormap_normalizations_custom.html#sphx-glr-gallery-userdemo-colormap-normalizations-custom-py).\r\n```python\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.colors as colors\r\n\r\nN = 100\r\n'''\r\nCustom Norm: An example with a customized normalization.  This one\r\nuses the example above, and normalizes the negative data differently\r\nfrom the positive.\r\n'''\r\nX, Y = np.mgrid[-3:3:complex(0, N), -2:2:complex(0, N)]\r\nZ1 = np.exp(-X**2 - Y**2)\r\nZ2 = np.exp(-(X - 1)**2 - (Y - 1)**2)\r\nZ = (Z1 - Z2) * 2\r\n\r\n\r\n# Example of making your own norm.  Also see matplotlib.colors.\r\n# From Joe Kington: This one gives two different linear ramps:\r\nclass MidpointNormalize(colors.Normalize):\r\n    def __init__(self, vmin=None, vmax=None, midpoint=None, clip=False):\r\n        self.midpoint = midpoint\r\n        colors.Normalize.__init__(self, vmin, vmax, clip)\r\n\r\n    def __call__(self, value, clip=None):\r\n        # I'm ignoring masked values and all kinds of edge cases to make a\r\n        # simple example...\r\n        x, y = [self.vmin, self.midpoint, self.vmax], [0, 0.5, 1]\r\n        return np.ma.masked_array(np.interp(value, x, y))\r\n\r\n\r\n#####\r\nfig, ax = plt.subplots(2, 1)\r\n\r\npcm = ax[0].pcolormesh(X, Y, Z,\r\n                       norm=MidpointNormalize(midpoint=0.),\r\n                       cmap='RdBu_r')\r\nfig.colorbar(pcm, ax=ax[0], extend='both')\r\n\r\npcm = ax[1].pcolormesh(X, Y, Z, cmap='RdBu_r', vmin=-np.max(Z))\r\nfig.colorbar(pcm, ax=ax[1], extend='both')\r\n\r\nplt.show()\r\n```\r\n![sphx_glr_colormap_normalizations_custom_001](https://user-images.githubusercontent.com/33796896/61923453-05ad9b80-af32-11e9-97e8-3a2ac31269df.png)\r\n","author":{"url":"https://github.com/stevenlis","@type":"Person","name":"stevenlis"},"datePublished":"2019-07-26T03:15:01Z","url":"https://github.com/matplotlib/matplotlib/issues/14892"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:21c2172d-1b86-a5d2-24d9-2ddbd805d428
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8980:20DDCE:FE2B73:1541AEF:6B065550
html-safe-nonce1424875a9f9c0ce2bb4aa3710b5cca580da24a0096adf74c9daf1a43503c4830
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OTgwOjIwRERDRTpGRTJCNzM6MTU0MUFFRjo2QjA2NTU1MCIsInZpc2l0b3JfaWQiOiI3NTkyODE3MTU1MzE0NzAxNjQ4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac9f40e574aad7afddc0923a8fe7d7fc6f6685e0f00151e80ff70e8b1536bd0a97
hovercard-subject-tagissue:473156782
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/14892/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f3aad0359d439a32611ba3e4352341333104784377d1d3b5e2c47c678986d559/matplotlib/matplotlib/issues/14892
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f3aad0359d439a32611ba3e4352341333104784377d1d3b5e2c47c678986d559/matplotlib/matplotlib/issues/14892
og:image:altI've seen many folks seeking a way to set 0 as the midpoint in a color bar. I wonder if this MidpointNormalize subclass could be added into matplotlib as a builtin function. The following code is c...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamestevenlis
hostnamegithub.com
expected-hostnamegithub.com
None6324e6ac990fb6befbec840cc0e102a1071c339bfe8f9826bb12de2e3ba1d297
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
release7f0aa75f4141d440c6110dc31af7ea7797abb6c4
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/issues/14892#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F14892
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F14892
Sign uphttps://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/14892
Reloadhttps://github.com/matplotlib/matplotlib/issues/14892
Reloadhttps://github.com/matplotlib/matplotlib/issues/14892
matplotlibhttps://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Codehttps://github.com/matplotlib/matplotlib
Issues1k (1k)https://github.com/matplotlib/matplotlib/issues
Pull requests430 (430)https://github.com/matplotlib/matplotlib/pulls
Actionshttps://github.com/matplotlib/matplotlib/actions
Projectshttps://github.com/matplotlib/matplotlib/projects
Wikihttps://github.com/matplotlib/matplotlib/wiki
Security and qualityhttps://github.com/matplotlib/matplotlib/security
Insightshttps://github.com/matplotlib/matplotlib/insights
https://github.com/matplotlib/matplotlib
New issuehttps://github.com/login?return_to=https://github.com/matplotlib/matplotlib/issues/14892
New issuehttps://github.com/login?return_to=https://github.com/matplotlib/matplotlib/issues/14892
#32540https://github.com/matplotlib/matplotlib/pull/32540
Doc: MidpointNormalize example should point to DivergingNorm as a built-in functionhttps://github.com/matplotlib/matplotlib/issues/14892#top
#32540https://github.com/matplotlib/matplotlib/pull/32540
Documentationhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22Documentation%22
v3.12.0https://github.com/matplotlib/matplotlib/milestone/97
https://github.com/stevenlis
stevenlishttps://github.com/stevenlis
on Jul 26, 2019https://github.com/matplotlib/matplotlib/issues/14892#issue-473156782
dochttps://matplotlib.org/3.1.1/gallery/userdemo/colormap_normalizations_custom.html#sphx-glr-gallery-userdemo-colormap-normalizations-custom-py
https://user-images.githubusercontent.com/33796896/61923453-05ad9b80-af32-11e9-97e8-3a2ac31269df.png
Nexthttps://github.com/matplotlib/matplotlib/issues/14892?timeline_page=1
https://github.com/story645
story645https://github.com/story645
on Jul 26, 2019https://github.com/matplotlib/matplotlib/issues/14892#issuecomment-515297369
https://matplotlib.org/api/_as_gen/matplotlib.colors.DivergingNorm.html#matplotlib.colors.DivergingNormhttps://matplotlib.org/api/_as_gen/matplotlib.colors.DivergingNorm.html#matplotlib.colors.DivergingNorm
stevenlishttps://github.com/stevenlis
completedhttps://github.com/matplotlib/matplotlib/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 26, 2019https://github.com/matplotlib/matplotlib/issues/14892#event-2511422118
https://github.com/stevenlis
stevenlishttps://github.com/stevenlis
on Jul 26, 2019https://github.com/matplotlib/matplotlib/issues/14892#issuecomment-515302269
@story645https://github.com/story645
WeatherGodhttps://github.com/WeatherGod
on Jul 26, 2019https://github.com/matplotlib/matplotlib/issues/14892#event-2512564249
WeatherGodhttps://github.com/WeatherGod
completedhttps://github.com/matplotlib/matplotlib/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 26, 2019https://github.com/matplotlib/matplotlib/issues/14892#event-2512566462
ImportanceOfBeingErnesthttps://github.com/ImportanceOfBeingErnest
on Jul 26, 2019https://github.com/matplotlib/matplotlib/issues/14892#event-2512714348
https://github.com/ImportanceOfBeingErnest
ImportanceOfBeingErnesthttps://github.com/ImportanceOfBeingErnest
on Jul 26, 2019https://github.com/matplotlib/matplotlib/issues/14892#issuecomment-515471144
the examplehttps://matplotlib.org/3.1.1/gallery/userdemo/colormap_normalizations_custom.html#sphx-glr-gallery-userdemo-colormap-normalizations-custom-py
Colormap Normalizationhttps://matplotlib.org/tutorials/colors/colormapnorms.html#divergingnorm-different-mapping-on-either-side-of-a-center
ImportanceOfBeingErnesthttps://github.com/ImportanceOfBeingErnest
on Jul 26, 2019https://github.com/matplotlib/matplotlib/issues/14892#event-2512736675
ImportanceOfBeingErnesthttps://github.com/ImportanceOfBeingErnest
v3.1-dochttps://github.com/matplotlib/matplotlib/milestone/45
on Jul 26, 2019https://github.com/matplotlib/matplotlib/issues/14892#event-2512737342
ImportanceOfBeingErnesthttps://github.com/ImportanceOfBeingErnest
backend: cairohttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22backend%3A%20cairo%22
Documentationhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22Documentation%22
backend: cairohttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22backend%3A%20cairo%22
on Jul 26, 2019https://github.com/matplotlib/matplotlib/issues/14892#event-2512738427
https://github.com/stevenlis
stevenlishttps://github.com/stevenlis
on Jul 26, 2019https://github.com/matplotlib/matplotlib/issues/14892#issuecomment-515477375
@ImportanceOfBeingErnesthttps://github.com/ImportanceOfBeingErnest
tacaswellhttps://github.com/tacaswell
v3.1-dochttps://github.com/matplotlib/matplotlib/milestone/45
3.2-dochttps://github.com/matplotlib/matplotlib/milestone/51
on Mar 15, 2020https://github.com/matplotlib/matplotlib/issues/14892#event-3130773404
QuLogichttps://github.com/QuLogic
v3.7.0https://github.com/matplotlib/matplotlib/milestone/70
on Jan 11, 2023https://github.com/matplotlib/matplotlib/issues/14892#event-8197586000
ksundenhttps://github.com/ksunden
v3.7.0https://github.com/matplotlib/matplotlib/milestone/70
v3.7.1https://github.com/matplotlib/matplotlib/milestone/80
on Feb 14, 2023https://github.com/matplotlib/matplotlib/issues/14892#event-8520600043
QuLogichttps://github.com/QuLogic
v3.7.1https://github.com/matplotlib/matplotlib/milestone/80
v3.7-dochttps://github.com/matplotlib/matplotlib/milestone/79
on Mar 4, 2023https://github.com/matplotlib/matplotlib/issues/14892#event-8664588816
QuLogichttps://github.com/QuLogic
v3.7-dochttps://github.com/matplotlib/matplotlib/milestone/79
v3.8-dochttps://github.com/matplotlib/matplotlib/milestone/83
on Sep 9, 2023https://github.com/matplotlib/matplotlib/issues/14892#event-10323449255
https://github.com/AnuTech-01
AnuTech-01https://github.com/AnuTech-01
on Oct 20, 2026https://github.com/matplotlib/matplotlib/issues/14892#issuecomment-6281510330
https://github.com/timhoffm
timhoffmhttps://github.com/timhoffm
on Oct 20, 2026https://github.com/matplotlib/matplotlib/issues/14892#issuecomment-6289920013
https://matplotlib.org/devdocs/gallery/images_contours_and_fields/colormap_normalizations.htmlhttps://matplotlib.org/devdocs/gallery/images_contours_and_fields/colormap_normalizations.html
https://matplotlib.org/devdocs/users/explain/colors/colormapnorms.htmlhttps://matplotlib.org/devdocs/users/explain/colors/colormapnorms.html
https://matplotlib.org/devdocs/users/explain/colors/colormapnorms.html#custom-normalization-manually-implement-two-linear-rangeshttps://matplotlib.org/devdocs/users/explain/colors/colormapnorms.html#custom-normalization-manually-implement-two-linear-ranges
https://github.com/AnuTech-01
AnuTech-01https://github.com/AnuTech-01
on Oct 21, 2026https://github.com/matplotlib/matplotlib/issues/14892#issuecomment-6305864243
https://github.com/timhoffm
timhoffmhttps://github.com/timhoffm
on Oct 22, 2026https://github.com/matplotlib/matplotlib/issues/14892#issuecomment-6340044456
https://github.com/matplotlib/matplotlib/blob/main/doc/sphinxext/redirect_from.pyhttps://github.com/matplotlib/matplotlib/blob/main/doc/sphinxext/redirect_from.py
https://github.com/AnuTech-01
AnuTech-01https://github.com/AnuTech-01
on Oct 23, 2026https://github.com/matplotlib/matplotlib/issues/14892#issuecomment-6355257283
timhoffmhttps://github.com/timhoffm
completedhttps://github.com/matplotlib/matplotlib/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#32540https://github.com/matplotlib/matplotlib/pull/32540
on Oct 31, 2026https://github.com/matplotlib/matplotlib/issues/14892#event-34787136366
QuLogichttps://github.com/QuLogic
v3.8-dochttps://github.com/matplotlib/matplotlib/milestone/83
v3.12.0https://github.com/matplotlib/matplotlib/milestone/97
on Nov 14, 2026https://github.com/matplotlib/matplotlib/issues/14892#event-36104306957
Sign up for freehttps://github.com/signup?return_to=https://github.com/matplotlib/matplotlib/issues/14892
Sign in to commenthttps://github.com/login?return_to=https://github.com/matplotlib/matplotlib/issues/14892
Documentationhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22Documentation%22
v3.12.0No due datehttps://github.com/matplotlib/matplotlib/milestone/97
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.