{"action":"created","issue":{"url":"https://api.github.com/repos/mwaskom/seaborn/issues/544","labels_url":"https://api.github.com/repos/mwaskom/seaborn/issues/544/labels{/name}","comments_url":"https://api.github.com/repos/mwaskom/seaborn/issues/544/comments","events_url":"https://api.github.com/repos/mwaskom/seaborn/issues/544/events","html_url":"https://github.com/mwaskom/seaborn/issues/544","id":74054947,"number":544,"title":"Incorrect ymax when passing `hist_kws={'histtype':'stepfilled'}` to `distplot` in a `FacetGrid` with the `hue`  parameter","user":{"login":"joelostblom","id":4560057,"avatar_url":"https://avatars.githubusercontent.com/u/4560057?v=3","gravatar_id":"","url":"https://api.github.com/users/joelostblom","html_url":"https://github.com/joelostblom","followers_url":"https://api.github.com/users/joelostblom/followers","following_url":"https://api.github.com/users/joelostblom/following{/other_user}","gists_url":"https://api.github.com/users/joelostblom/gists{/gist_id}","starred_url":"https://api.github.com/users/joelostblom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelostblom/subscriptions","organizations_url":"https://api.github.com/users/joelostblom/orgs","repos_url":"https://api.github.com/users/joelostblom/repos","events_url":"https://api.github.com/users/joelostblom/events{/privacy}","received_events_url":"https://api.github.com/users/joelostblom/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-07T16:54:37Z","updated_at":"2015-05-07T19:06:45Z","closed_at":null,"body":"An example that cuts of the axis when passing `hist_kws={'histtype':'stepfilled'}`\r\n```python\r\ng = sns.FacetGrid(data=iris, hue='species', size = 3)\r\ng.map(sns.distplot, 'petal_length', hist_kws={'histtype':'stepfilled'})\r\n```\r\n![image](https://cloud.githubusercontent.com/assets/4560057/7520877/f9b75e62-f4b7-11e4-9504-f8ec2e8e80b4.png)\r\n\r\nPassing different `hist_kws` seem to work\r\n```python\r\ng = sns.FacetGrid(data=iris, hue='species', size = 3)\r\ng.map(sns.distplot, 'petal_length', hist_kws={'linewidth':0})\r\n```\r\n![image](https://cloud.githubusercontent.com/assets/4560057/7520886/0d1ea26c-f4b8-11e4-81ca-92650c0049fa.png)\r\n\r\nIn the upper plot, it looks like ymax is set according to the red distribution. This seems to be specific to `FacetGrid`s using the `hue` parameter. I couldn't reproduce it without `hue` or with `distplot` directly (although I didn't test this extensively)."},"comment":{"url":"https://api.github.com/repos/mwaskom/seaborn/issues/comments/99983579","html_url":"https://github.com/mwaskom/seaborn/issues/544#issuecomment-99983579","issue_url":"https://api.github.com/repos/mwaskom/seaborn/issues/544","id":99983579,"user":{"login":"joelostblom","id":4560057,"avatar_url":"https://avatars.githubusercontent.com/u/4560057?v=3","gravatar_id":"","url":"https://api.github.com/users/joelostblom","html_url":"https://github.com/joelostblom","followers_url":"https://api.github.com/users/joelostblom/followers","following_url":"https://api.github.com/users/joelostblom/following{/other_user}","gists_url":"https://api.github.com/users/joelostblom/gists{/gist_id}","starred_url":"https://api.github.com/users/joelostblom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelostblom/subscriptions","organizations_url":"https://api.github.com/users/joelostblom/orgs","repos_url":"https://api.github.com/users/joelostblom/repos","events_url":"https://api.github.com/users/joelostblom/events{/privacy}","received_events_url":"https://api.github.com/users/joelostblom/received_events","type":"User","site_admin":false},"created_at":"2015-05-07T19:06:44Z","updated_at":"2015-05-07T19:06:44Z","body":"I couldn't reproduce it without `hue` or with `distplot` directly (although I didn't test this extensively).\r\n\r\nI think the reason for this behavior is that `ymax` seems to be calculated for the last species distribution in alphabetic order rather than the distribution with the highest `ymax`. I did some quick testing that supports this.\r\n```python\r\ng = sns.FacetGrid(data=iris, hue='species', size = 3)\r\ng.map(sns.distplot, 'petal_length', hist_kws={'histtype':'stepfilled'})\r\ng.add_legend()\r\n```\r\n![image](https://cloud.githubusercontent.com/assets/4560057/7523481/0d8e6022-f4ca-11e4-9c7c-f614f6aec990.png)\r\n\r\nChanging the species 'setosa' to 'wsetosa' sets the ymax in respect to this distribution instead.\r\n```python\r\niris.loc[iris.species == 'setosa', 'species'] = 'wsetosa'\r\ng = sns.FacetGrid(data=iris, hue='species', size = 3)\r\ng.map(sns.distplot, 'petal_length', hist_kws={'histtype':'stepfilled'})\r\ng.add_legend()\r\n```\r\n![image](https://cloud.githubusercontent.com/assets/4560057/7523518/40cdf966-f4ca-11e4-9e88-b35bcf8c75af.png)\r\n"}}