Title: `SymLogNorm` and `SymLogScale` give inconsistent results.... · Issue #16376 · matplotlib/matplotlib · GitHub
Open Graph Title: `SymLogNorm` and `SymLogScale` give inconsistent results.... · Issue #16376 · matplotlib/matplotlib
X Title: `SymLogNorm` and `SymLogScale` give inconsistent results.... · Issue #16376 · matplotlib/matplotlib
Description: on master.... import matplotlib.pyplot as plt import numpy as np import matplotlib.scale as mscale import matplotlib.colors as mcolors #scale = mscale.SymmetricalLogScale(ax.xaxis, linthreshx=1.0) fig, ax =plt.subplots() ax.set_xscale('s...
Open Graph Description: on master.... import matplotlib.pyplot as plt import numpy as np import matplotlib.scale as mscale import matplotlib.colors as mcolors #scale = mscale.SymmetricalLogScale(ax.xaxis, linthreshx=1.0) ...
X Description: on master.... import matplotlib.pyplot as plt import numpy as np import matplotlib.scale as mscale import matplotlib.colors as mcolors #scale = mscale.SymmetricalLogScale(ax.xaxis, linthreshx=1.0) ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/16376
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`SymLogNorm` and `SymLogScale` give inconsistent results....","articleBody":"on master....\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport matplotlib.scale as mscale\r\nimport matplotlib.colors as mcolors\r\n\r\n#scale = mscale.SymmetricalLogScale(ax.xaxis, linthreshx=1.0)\r\nfig, ax =plt.subplots()\r\nax.set_xscale('symlog', linthreshx=1.0, linscale=1)\r\n\r\nax.plot(np.arange(-100, 100, 0.1), np.arange(-100, 100, 0.1))\r\nax.set_xlim([-100, 100])\r\nscale = ax.xaxis._scale\r\n\r\nnorm = mcolors.SymLogNorm(linthresh=1.0, linscale=1, vmin=-100, vmax=100)\r\nxx = scale._transform.transform([-200, -100, -10, -1, -0.5, 0, 0.5, 1, 10, 100, 200])\r\n\r\nprint((xx - xx[1])/(xx[-2] - xx[1]))\r\nprint(norm([-200, -100, -10, -1, -0.5, 0, 0.5, 1, 10, 100, 200]))\r\n\r\n\r\nfig, ax = plt.subplots()\r\nax.plot(norm([-200, -100, -10, -1, -0.5, 0, 0.5, 1, 10, 100, 200]), xx, '.')\r\nax.set_xlabel('Norm')\r\nax.set_ylabel('Scale')\r\n```\r\n\r\nyields\r\n\r\n```\r\n[-0.0483798207317112 0.0 0.1607142857142857 0.3214285714285714\r\n 0.4107142857142857 0.5 0.5892857142857143 0.6785714285714286\r\n 0.8392857142857143 1.0 1.0483798207317112] # scale\r\n[-0.05601509 0. 0.1860781 0.3721562 0.4360781 0.5\r\n 0.5639219 0.6278438 0.8139219 1. 1.05601509] # Norm\r\n```\r\n\r\nI think scale is right, and norm is wrong...\r\n\r\n\r\n\r\n\r\n\r\n","author":{"url":"https://github.com/jklymak","@type":"Person","name":"jklymak"},"datePublished":"2020-01-30T22:23:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/16376/matplotlib/issues/16376"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a04e459e-c084-ce62-95c2-b3f3241c1e41 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BAB6:166C0A:C0E62F:1185619:6A55FD53 |
| html-safe-nonce | d7add6b274df4053c44a77b015b4b902e9cd83b48e40dd5c542c5df0dee86b5f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQUI2OjE2NkMwQTpDMEU2MkY6MTE4NTYxOTo2QTU1RkQ1MyIsInZpc2l0b3JfaWQiOiI4MTcxMjkyNTUxMDg3MzgzODciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 385f0e3c1f892b908bc3a922f19d06a8b49e805145d8c6129efa4b4cdec0eb7a |
| hovercard-subject-tag | issue:557792692 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/16376/issue_layout |
| twitter:image | https://opengraph.githubassets.com/94711ca8b90b5c33934d4bfa2cb653a86442e72a19ff1572615adbf29db5bafa/matplotlib/matplotlib/issues/16376 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/94711ca8b90b5c33934d4bfa2cb653a86442e72a19ff1572615adbf29db5bafa/matplotlib/matplotlib/issues/16376 |
| og:image:alt | on master.... import matplotlib.pyplot as plt import numpy as np import matplotlib.scale as mscale import matplotlib.colors as mcolors #scale = mscale.SymmetricalLogScale(ax.xaxis, linthreshx=1.0) ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jklymak |
| hostname | github.com |
| expected-hostname | github.com |
| None | f4368738fc918fecd9b3958f6b49218bbe60d4185f38e72e3954e11f1ad0213a |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ed27e29ef37c0e8f612ea3fed8118b955b8314e2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width