Title: plot.scatter: negative or null values lead to strange behavior on log scale · Issue #11898 · matplotlib/matplotlib · GitHub
Open Graph Title: plot.scatter: negative or null values lead to strange behavior on log scale · Issue #11898 · matplotlib/matplotlib
X Title: plot.scatter: negative or null values lead to strange behavior on log scale · Issue #11898 · matplotlib/matplotlib
Description: Bug report Related issues have already been reported but I think a simpler case is worth mentioning: Bug summary With negative or null values, log scale fails (although it does not crashes) discarding (masking) more points than the ones ...
Open Graph Description: Bug report Related issues have already been reported but I think a simpler case is worth mentioning: Bug summary With negative or null values, log scale fails (although it does not crashes) discard...
X Description: Bug report Related issues have already been reported but I think a simpler case is worth mentioning: Bug summary With negative or null values, log scale fails (although it does not crashes) discard...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/11898
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"plot.scatter: negative or null values lead to strange behavior on log scale","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\nRelated issues have already been reported but I think a simpler case is worth mentioning:\r\n\r\n**Bug summary**\r\n\r\n\u003c!--A short 1-2 sentences that succinctly describes the bug--\u003e\r\nWith negative or null values, log scale fails (although it does not crashes) discarding (masking) more points than the ones corresponding to the invalid negative or null values. At least a WARNING would be welcome.\r\n\r\n**Code for reproduction**\r\n\u003c!--A minimum code snippet required to reproduce the bug, also minimizing the number of dependencies required--\u003e\r\nNormal behavior: only positive values in `y` :\r\n```python\r\nx = [1, 2, 3, 4]\r\ny = [1, 10, 50, 100]\r\nplt.scatter(x, y)\r\nplt.yscale('log')\r\n```\r\n**Actual outcome**: \r\n\r\n\r\nBug: with value 0 in `y` (idem with negative values):\r\n```python\r\nx = [1, 2, 3, 4]\r\ny = [0, 10, 50, 100]\r\nplt.scatter(x, y)\r\nplt.yscale('log')\r\n```\r\n**Actual outcome**: only the last point is displayed.\r\n\u003c!--The output produced by the above code, which may be a screenshot, console output, etc.--\u003e\r\n\r\n\r\n**Expected outcome**\r\nI understand that default behavior is masking of non positive values. But it seems that more values are masked. I tried chaging parameter `nonposy` : `plt.yscale('log', nonposy='clip')` but the behavior is the same.\r\nAt least a WARNING should be displayed about presence of negative or null values not compatible with log scale.\r\n\r\n\u003c!--A description of the expected outcome from the code snippet--\u003e\r\n\u003c!--If this used to work in an earlier version of Matplotlib, please note the version it used to work on--\u003e\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 14.04.3 LTS\r\n * Matplotlib version: 2.2.2\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): module://ipykernel.pylab.backend_inline\r\n * Python version: 3.6.5\r\n * Jupyter version (if applicable): 5.5.0\r\n * Other libraries: \r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\nmatplotlib installed from conda default.","author":{"url":"https://github.com/ivankeller","@type":"Person","name":"ivankeller"},"datePublished":"2018-08-20T09:30:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":13},"url":"https://github.com/11898/matplotlib/issues/11898"}
| 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:45f6a3a7-7dc9-ff11-76ac-01e14a7f2769 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C374:B6D9A:18E0CC1:211FFE9:6A52C513 |
| html-safe-nonce | a92d27accf87a9013bd41104caeb9681a6a34f9aa78f133ff37721857f20ae9b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzc0OkI2RDlBOjE4RTBDQzE6MjExRkZFOTo2QTUyQzUxMyIsInZpc2l0b3JfaWQiOiI1NzU2MjIyMDkwNzk4ODc1OTIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 39b66fe85f2d4024fa8d10238f45560402fae14c0f1313606fff63120dae2b0d |
| hovercard-subject-tag | issue:352054317 |
| 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/11898/issue_layout |
| twitter:image | https://opengraph.githubassets.com/607812cb05db547a8b519db4daaaf1891883b308472933c96ff4ae36d0df5be3/matplotlib/matplotlib/issues/11898 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/607812cb05db547a8b519db4daaaf1891883b308472933c96ff4ae36d0df5be3/matplotlib/matplotlib/issues/11898 |
| og:image:alt | Bug report Related issues have already been reported but I think a simpler case is worth mentioning: Bug summary With negative or null values, log scale fails (although it does not crashes) discard... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ivankeller |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width