Title: Scatterplot: should vmin/vmax be ignored when a norm is specified? · Issue #14603 · matplotlib/matplotlib · GitHub
Open Graph Title: Scatterplot: should vmin/vmax be ignored when a norm is specified? · Issue #14603 · matplotlib/matplotlib
X Title: Scatterplot: should vmin/vmax be ignored when a norm is specified? · Issue #14603 · matplotlib/matplotlib
Description: Bug report Bug summary The scatter documentation says: vmin and vmax are ignored if you pass a norm instance. However, it seems that this is not the case. Is the documentation correct of the behaviour? Code for reproduction import numpy ...
Open Graph Description: Bug report Bug summary The scatter documentation says: vmin and vmax are ignored if you pass a norm instance. However, it seems that this is not the case. Is the documentation correct of the behavi...
X Description: Bug report Bug summary The scatter documentation says: vmin and vmax are ignored if you pass a norm instance. However, it seems that this is not the case. Is the documentation correct of the behavi...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/14603
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Scatterplot: should vmin/vmax be ignored when a norm is specified?","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\n\r\nThe `scatter` documentation says:\r\n\r\n\u003e *vmin* and *vmax* are ignored if you pass a *norm* instance.\r\n\r\nHowever, it seems that this is not the case. Is the documentation correct of the behaviour?\r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib\r\n\r\ncmap = matplotlib.cm.viridis_r\r\nnorm = matplotlib.colors.BoundaryNorm([1,3,6,8], cmap.N, clip=True)\r\n\r\nvalues = np.arange(10)\r\n\r\n# only specifying a norm\r\nplt.scatter(values, values, c=values, norm=norm)\r\n\r\n# also specifying vmin/vmax. Should those be ignored?\r\nplt.scatter(values, values, c=values, norm=norm, vmin=6, vmax=10)\r\n```\r\n\r\n**Actual outcome**\r\n\r\n```\r\n# only specifying a norm\r\nplt.scatter(values, values, c=values, norm=norm)\r\n```\r\n\r\n\r\n\r\n```\r\n# also specifying vmin/vmax. Should those be ignored?\r\nplt.scatter(values, values, c=values, norm=norm, vmin=6, vmax=10)\r\n```\r\n\r\n\r\n\r\nSo the vmin/vmax have clearly \"altered\" the BoundaryNorm applied on the data.\r\n\r\nAccording to the documentation, this should not happen. \r\nSpecifically for a BoundaryNorm (with specified bounds), it seems strange let the plotting change those bounds.\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: Ubuntu 16.04\r\n * Matplotlib version: 3.1.0\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): notebook inline backend\r\n * Python version: 3.7\r\n * Installed from conda-forge\r\n","author":{"url":"https://github.com/jorisvandenbossche","@type":"Person","name":"jorisvandenbossche"},"datePublished":"2019-06-23T22:54:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/14603/matplotlib/issues/14603"}
| 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:56aeb1e4-680f-10c1-f2d5-941133efa6ca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C60:13CB91:DB2F8F:12A9DAF:6A5216EE |
| html-safe-nonce | b151dc132b4492ae9956762da4b77b3f3c013ce41d8076bb240cf1fc3d5d5fbd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzYwOjEzQ0I5MTpEQjJGOEY6MTJBOURBRjo2QTUyMTZFRSIsInZpc2l0b3JfaWQiOiI4MzA0NTA1NTU3Mzg1Mjc0NzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 91f2e286b295d52df583cdfb78e7bff4e2c5c3398cbe61d6547ca9ffdde1352f |
| hovercard-subject-tag | issue:459627378 |
| 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/14603/issue_layout |
| twitter:image | https://opengraph.githubassets.com/61c2dd190294cb09325d1fb47c15bfbe3e263b11c2917645580aafdb76fb43c5/matplotlib/matplotlib/issues/14603 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/61c2dd190294cb09325d1fb47c15bfbe3e263b11c2917645580aafdb76fb43c5/matplotlib/matplotlib/issues/14603 |
| og:image:alt | Bug report Bug summary The scatter documentation says: vmin and vmax are ignored if you pass a norm instance. However, it seems that this is not the case. Is the documentation correct of the behavi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jorisvandenbossche |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width