{"action":"created","issue":{"url":"https://api.github.com/repos/mwaskom/seaborn/issues/459","labels_url":"https://api.github.com/repos/mwaskom/seaborn/issues/459/labels{/name}","comments_url":"https://api.github.com/repos/mwaskom/seaborn/issues/459/comments","events_url":"https://api.github.com/repos/mwaskom/seaborn/issues/459/events","html_url":"https://github.com/mwaskom/seaborn/issues/459","id":59144551,"number":459,"title":"Heatmap colorbar should respect value of 'ticks'  in cbar_kws","user":{"login":"hanslovsky","id":1086317,"avatar_url":"https://avatars.githubusercontent.com/u/1086317?v=3","gravatar_id":"","url":"https://api.github.com/users/hanslovsky","html_url":"https://github.com/hanslovsky","followers_url":"https://api.github.com/users/hanslovsky/followers","following_url":"https://api.github.com/users/hanslovsky/following{/other_user}","gists_url":"https://api.github.com/users/hanslovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/hanslovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hanslovsky/subscriptions","organizations_url":"https://api.github.com/users/hanslovsky/orgs","repos_url":"https://api.github.com/users/hanslovsky/repos","events_url":"https://api.github.com/users/hanslovsky/events{/privacy}","received_events_url":"https://api.github.com/users/hanslovsky/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mwaskom/seaborn/labels/annoyance","name":"annoyance","color":"f7c6c7"},{"url":"https://api.github.com/repos/mwaskom/seaborn/labels/enhancement","name":"enhancement","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-02-26T21:14:26Z","updated_at":"2015-05-04T13:56:43Z","closed_at":null,"body":"When you add a `'ticks'` keyword to `cbar_kws`, python will crash because the keyword `'ticks'` appears twice in the same funciton call. In order to avoid that, default ticks should only be created, if `'ticks'` is not present in `cbar_kws`.\r\n\r\n```python\r\nimport seaborn as sns\r\nimport numpy as np\r\nfrom matplotlib import pyplot as plt\r\n\r\nmat = np.random.randn( 20, 20 )\r\ncbar_kws = { 'ticks' : [ np.min(mat), np.max(mat) ] }\r\nsns.heatmap( mat, square=True, cbar_kws=cbar_kws )\r\nplt.show()\r\n```\r\nThis code snippet fail with\r\n```bash\r\n/usr/lib/python2.7/site-packages/matplotlib/__init__.py:479: UserWarning: matplotlibrc text.usetex option can not be used unless TeX-3.1415 or later is installed on your system\r\n  'installed on your system') % tex_req)\r\n/usr/lib/python2.7/site-packages/matplotlib/__init__.py:485: UserWarning: matplotlibrc text.usetex can not be used with *Agg backend unless dvipng-1.5 or later is installed on your system\r\n  warnings.warn( 'matplotlibrc text.usetex can not be used with *Agg '\r\n/usr/lib/python2.7/site-packages/matplotlib/__init__.py:499: UserWarning: matplotlibrc text.usetex can not be used unless ghostscript-7.07 or later is installed on your system\r\n  'installed on your system') % gs_req)\r\nTraceback (most recent call last):\r\n  File \"seaborn-example.py\", line 9, in <module>\r\n    sns.heatmap( mat, square=True, cbar_kws=cbar_kws )\r\n  File \"/home/phil/local/lib/python2.7/site-packages/seaborn-0.6.dev0-py2.7.egg/seaborn/matrix.py\", line 292, in heatmap\r\n    plotter.plot(ax, cbar_ax, kwargs)\r\n  File \"/home/phil/local/lib/python2.7/site-packages/seaborn-0.6.dev0-py2.7.egg/seaborn/matrix.py\", line 193, in plot\r\n    ticks=ticker, **self.cbar_kws)\r\nTypeError: colorbar() got multiple values for keyword argument 'ticks'\r\n```\r\n\r\nCompare this commit that solved the problem:\r\n5761bf0c7a9ad6e6b0b67209f83d160228905d16\r\n\r\nIf you agree on that issue, I'll create a pull request."},"comment":{"url":"https://api.github.com/repos/mwaskom/seaborn/issues/comments/98712936","html_url":"https://github.com/mwaskom/seaborn/issues/459#issuecomment-98712936","issue_url":"https://api.github.com/repos/mwaskom/seaborn/issues/459","id":98712936,"user":{"login":"hanslovsky","id":1086317,"avatar_url":"https://avatars.githubusercontent.com/u/1086317?v=3","gravatar_id":"","url":"https://api.github.com/users/hanslovsky","html_url":"https://github.com/hanslovsky","followers_url":"https://api.github.com/users/hanslovsky/followers","following_url":"https://api.github.com/users/hanslovsky/following{/other_user}","gists_url":"https://api.github.com/users/hanslovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/hanslovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hanslovsky/subscriptions","organizations_url":"https://api.github.com/users/hanslovsky/orgs","repos_url":"https://api.github.com/users/hanslovsky/repos","events_url":"https://api.github.com/users/hanslovsky/events{/privacy}","received_events_url":"https://api.github.com/users/hanslovsky/received_events","type":"User","site_admin":false},"created_at":"2015-05-04T13:56:42Z","updated_at":"2015-05-04T13:56:42Z","body":"Got distracted by work, but I'll add it."}}