{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/3973","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/3973/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/3973/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/3973/events","html_url":"https://github.com/matplotlib/matplotlib/pull/3973","id":53594805,"number":3973,"title":"BUG: Convert qualitative colormaps to ListedColormap","user":{"login":"endolith","id":58611,"avatar_url":"https://avatars.githubusercontent.com/u/58611?v=3","gravatar_id":"","url":"https://api.github.com/users/endolith","html_url":"https://github.com/endolith","followers_url":"https://api.github.com/users/endolith/followers","following_url":"https://api.github.com/users/endolith/following{/other_user}","gists_url":"https://api.github.com/users/endolith/gists{/gist_id}","starred_url":"https://api.github.com/users/endolith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endolith/subscriptions","organizations_url":"https://api.github.com/users/endolith/orgs","repos_url":"https://api.github.com/users/endolith/repos","events_url":"https://api.github.com/users/endolith/events{/privacy}","received_events_url":"https://api.github.com/users/endolith/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/matplotlib/matplotlib/labels/API%20Changes","name":"API Changes","color":"000000"},{"url":"https://api.github.com/repos/matplotlib/matplotlib/labels/needs_review","name":"needs_review","color":"009800"},{"url":"https://api.github.com/repos/matplotlib/matplotlib/labels/needs_revision","name":"needs_revision","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/19","html_url":"https://github.com/matplotlib/matplotlib/milestones/Color%20overhaul","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/19/labels","id":982168,"number":19,"title":"Color overhaul","description":"v2.0.0 milestone\r\n\r\nThe v2.0 will be based on the 1.4.3 release and contain only default color changes and bug-fixes.","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":6,"state":"open","created_at":"2015-02-17T00:47:12Z","updated_at":"2015-03-08T01:08:46Z","due_on":"2015-03-20T04:00:00Z","closed_at":null},"comments":2,"created_at":"2015-01-07T03:50:27Z","updated_at":"2015-03-08T17:05:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/3973","html_url":"https://github.com/matplotlib/matplotlib/pull/3973","diff_url":"https://github.com/matplotlib/matplotlib/pull/3973.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/3973.patch"},"body":"\"Qualitative\" colormaps are designed to be used on things like chloropleths, not smoothly-varying heatmaps, in applications such as [scipy.ndimage.measurements.label](http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.ndimage.measurements.label.html).  It would be nice to have some predefined named maps for this purpose.  ColorBrewer has some (Accent, Dark2, Paired, Pastel1, Pastel2, Set1, Set2, Set3) but they were [mistakenly](https://github.com/matplotlib/matplotlib/issues/881#issuecomment-5799075) created as LinearSegmentedColormap when they should have been ListedColormap, so I converted them.\r\n\r\nI left these colormaps in the same _cm.py file and \"tagged\" them with a dictionary and hacked in a path for them to be implemented as ListedColormap.  This is hacky and I expect you to reject it, but I don't know of a better way right now.  Please suggest a more proper way to implement this, moving them to their own file, etc.\r\n\r\nIn https://github.com/matplotlib/matplotlib/issues/881 there was concern that this would cause backward compatibility problems, but this won't actually \"break\" any existing code that uses them, they can still be used for heatmaps, the images will just become solid colors instead:\r\n\r\n![Paired original](https://cloud.githubusercontent.com/assets/58611/5640574/132047d2-95f5-11e4-85f4-b6df986a8835.png)\r\n![Paired ListedColormap](https://cloud.githubusercontent.com/assets/58611/5640573/131b8c42-95f5-11e4-83e0-c9a524019d04.png)\r\n\r\nThey're pretty ugly when used as heatmaps, so I doubt they are being used this way very often."},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/77761558","html_url":"https://github.com/matplotlib/matplotlib/pull/3973#issuecomment-77761558","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/3973","id":77761558,"user":{"login":"endolith","id":58611,"avatar_url":"https://avatars.githubusercontent.com/u/58611?v=3","gravatar_id":"","url":"https://api.github.com/users/endolith","html_url":"https://github.com/endolith","followers_url":"https://api.github.com/users/endolith/followers","following_url":"https://api.github.com/users/endolith/following{/other_user}","gists_url":"https://api.github.com/users/endolith/gists{/gist_id}","starred_url":"https://api.github.com/users/endolith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/endolith/subscriptions","organizations_url":"https://api.github.com/users/endolith/orgs","repos_url":"https://api.github.com/users/endolith/repos","events_url":"https://api.github.com/users/endolith/events{/privacy}","received_events_url":"https://api.github.com/users/endolith/received_events","type":"User","site_admin":false},"created_at":"2015-03-08T17:05:40Z","updated_at":"2015-03-08T17:05:40Z","body":"Ok, I fixed the spacing issue.\r\n\r\nIt was said that \"dumping them in as if they were continuous was a mistake\", so this could be considered a bugfix rather than a new feature, but 2.0 is fine.  I like whatever you like.  :)\r\n\r\nAny ideas on how to implement this correctly instead of using the dictionary label hack?  Should they be in a separate dictionary than `datad`?"}}