{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/10890","repository_url":"https://api.github.com/repos/matplotlib/matplotlib","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/10890/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/10890/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/10890/events","html_url":"https://github.com/matplotlib/matplotlib/issues/10890","id":308990115,"number":10890,"title":"Bug causes to_rgba to fail inside cm.py","user":{"login":"Eagleames","id":24260928,"avatar_url":"https://avatars3.githubusercontent.com/u/24260928?v=4","gravatar_id":"","url":"https://api.github.com/users/Eagleames","html_url":"https://github.com/Eagleames","followers_url":"https://api.github.com/users/Eagleames/followers","following_url":"https://api.github.com/users/Eagleames/following{/other_user}","gists_url":"https://api.github.com/users/Eagleames/gists{/gist_id}","starred_url":"https://api.github.com/users/Eagleames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eagleames/subscriptions","organizations_url":"https://api.github.com/users/Eagleames/orgs","repos_url":"https://api.github.com/users/Eagleames/repos","events_url":"https://api.github.com/users/Eagleames/events{/privacy}","received_events_url":"https://api.github.com/users/Eagleames/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-03-27T14:19:51Z","updated_at":"2018-03-27T16:37:18Z","closed_at":null,"author_association":"NONE","body":"I was running a test with some new images and plotting, code called cm.to_rgba() to convert the files for keras processing.\r\n\r\nMatplotlib 2.1.2 (but verified in the current repository)\r\n\r\nIt 'works' however it throws an error, by mistake due to this error in code:\r\n                if xx.dtype.kind == 'f':\r\n                    if norm and xx.max() > 1 or xx.min() < 0:\r\n                        raise ValueError(\"Floating point image RGB values \"\r\n                                         \"must be in the 0..1 range.\")\r\n\r\nIf xx.min() <0 then this code piece triggers.\r\n\r\nShould be:\r\n                if xx.dtype.kind == 'f':\r\n                    if norm and (xx.max() > 1 or xx.min() < 0):\r\n                        raise ValueError(\"Floating point image RGB values \"\r\n                                         \"must be in the 0..1 range.\")\r\n\r\nSorry.. not familiar enough with making pull requests and changes myself to do this!\r\n"},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/376591697","html_url":"https://github.com/matplotlib/matplotlib/issues/10890#issuecomment-376591697","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/10890","id":376591697,"user":{"login":"Eagleames","id":24260928,"avatar_url":"https://avatars3.githubusercontent.com/u/24260928?v=4","gravatar_id":"","url":"https://api.github.com/users/Eagleames","html_url":"https://github.com/Eagleames","followers_url":"https://api.github.com/users/Eagleames/followers","following_url":"https://api.github.com/users/Eagleames/following{/other_user}","gists_url":"https://api.github.com/users/Eagleames/gists{/gist_id}","starred_url":"https://api.github.com/users/Eagleames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eagleames/subscriptions","organizations_url":"https://api.github.com/users/Eagleames/orgs","repos_url":"https://api.github.com/users/Eagleames/repos","events_url":"https://api.github.com/users/Eagleames/events{/privacy}","received_events_url":"https://api.github.com/users/Eagleames/received_events","type":"User","site_admin":false},"created_at":"2018-03-27T16:37:18Z","updated_at":"2018-03-27T16:37:18Z","author_association":"NONE","body":"I suppose that if the documentation says that the input should be normalized... it is the 'correct' place to go from, however it does make it so that this error check is meaningless as neither the normalize or the value checks can ever fail.\r\n\r\nI can tell you that if you just put the brackets in (2.1.2) the result you get is a graph of the data normalized across the full color range... unfortunately I didn't take a screenshot and just updated to 2.2.2.\r\n\r\nMy feeling is that the normalization requirement should only be there if it is truly needed, and since it is not... It is better to effectively do the normalization in the color space rather than to corrupt the data by clipping.\r\n\r\nIf the normalized input was a hard requirement, I would prefer it throw an error if I passed it un-normalized data rather than show me a false image (with a screen flag I might not catch).\r\n\r\nThis can be the kind of problem you chase your tail around for hours as a student... not realizing how 'severe' the clipping was in your image. (note that up to 100x range is lost in the clipping for our example above)\r\n\r\n"}}
{"actor":{"display_login":"Eagleames"}}