Title: Passing clim as keyword argument to pcolormesh does not change limits. · Issue #10346 · matplotlib/matplotlib · GitHub
Open Graph Title: Passing clim as keyword argument to pcolormesh does not change limits. · Issue #10346 · matplotlib/matplotlib
X Title: Passing clim as keyword argument to pcolormesh does not change limits. · Issue #10346 · matplotlib/matplotlib
Description: Bug report Bug summary Not sure if this is really a bug or just a user issue. I expected that passing a clim tuple to pcolormesh with no vmin or vmax specified would update the color scale limits. I found that I had to use vmin and vmax ...
Open Graph Description: Bug report Bug summary Not sure if this is really a bug or just a user issue. I expected that passing a clim tuple to pcolormesh with no vmin or vmax specified would update the color scale limits. ...
X Description: Bug report Bug summary Not sure if this is really a bug or just a user issue. I expected that passing a clim tuple to pcolormesh with no vmin or vmax specified would update the color scale limits. ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/10346
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Passing clim as keyword argument to pcolormesh does not change limits.","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\n\r\nNot sure if this is really a bug or just a user issue. I expected that passing a `clim` tuple to `pcolormesh` with no `vmin` or `vmax` specified would update the color scale limits. I found that I had to use `vmin` and `vmax` instead. Maybe I am misunderstanding and `vmin` and `vmax` should always be used. However, it looks like the kwargs are passed into the `QuadMesh` constructor and then `clim` is overwritten with `vmin` and `vmax`, even in they are None and `clim` is given. (https://github.com/heath730/matplotlib/blob/master/lib/matplotlib/axes/_axes.py#L5629). \r\n\r\n**Code for reproduction**\r\n\r\n``` python\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\n\r\nplot_me = np.random.rand(5, 5)\r\n\r\nplt.subplot(211)\r\nplt.title(\"Expected\")\r\nplt.pcolormesh(plot_me, vmin=0, vmax=0.5)\r\nplt.colorbar()\r\n\r\nplt.subplot(212)\r\nplt.title(\"Result\")\r\nplt.pcolormesh(plot_me, clim=(0, 0.5))\r\nplt.colorbar()\r\n\r\nplt.show()\r\n\r\n```\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: win7\r\n * Matplotlib version: 2.1.2\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): TkAgg\r\n * Python version: 3.5.1\r\n * Jupyter version (if applicable):\r\n * Other libraries: \r\n\r\n\r\nWould something like:\r\n``` python \r\n (vmin, vmax) = kwargs.pop('clim', (None, None))\r\n```\r\nBefore the vmin and vmax pops on this [line](https://github.com/heath730/matplotlib/blob/master/lib/matplotlib/axes/_axes.py#L5594) be a reasonable update? \r\n","author":{"url":"https://github.com/heathhenley","@type":"Person","name":"heathhenley"},"datePublished":"2018-01-30T03:10:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/10346/matplotlib/issues/10346"}
| 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:eccf7a56-53e8-4ccb-32bd-d808ce77fed7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AC02:21FDDF:20674A6:2F0D6FF:6A54F050 |
| html-safe-nonce | 249f67960c053ad19ad0d92ee24320ffee373be382f85f1665b26ed42407bd20 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzAyOjIxRkRERjoyMDY3NEE2OjJGMEQ2RkY6NkE1NEYwNTAiLCJ2aXNpdG9yX2lkIjoiMzc3NjA1MjA3MDk2NjE5MDg4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6989248a4bdd75e3246425fb413b6ee7a6fffa35efe98fc2006190c26e4aa317 |
| hovercard-subject-tag | issue:292638461 |
| 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/10346/issue_layout |
| twitter:image | https://opengraph.githubassets.com/089a7645eaaed7015668359da2ca63951ccacbc818be73a5761b48a9bf8d854a/matplotlib/matplotlib/issues/10346 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/089a7645eaaed7015668359da2ca63951ccacbc818be73a5761b48a9bf8d854a/matplotlib/matplotlib/issues/10346 |
| og:image:alt | Bug report Bug summary Not sure if this is really a bug or just a user issue. I expected that passing a clim tuple to pcolormesh with no vmin or vmax specified would update the color scale limits. ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | heathhenley |
| hostname | github.com |
| expected-hostname | github.com |
| None | eae2aab99907699a22d2c8449aa683ca74454fca87211b98f7c7b722086b2839 |
| 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 | dd26d3896747463b6bd56edd5e290edb595c3cbc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width