{"action":"created","issue":{"url":"https://api.github.com/repos/mwaskom/seaborn/issues/1598","repository_url":"https://api.github.com/repos/mwaskom/seaborn","labels_url":"https://api.github.com/repos/mwaskom/seaborn/issues/1598/labels{/name}","comments_url":"https://api.github.com/repos/mwaskom/seaborn/issues/1598/comments","events_url":"https://api.github.com/repos/mwaskom/seaborn/issues/1598/events","html_url":"https://github.com/mwaskom/seaborn/issues/1598","id":375106449,"node_id":"MDU6SXNzdWUzNzUxMDY0NDk=","number":1598,"title":"Rotating xticklabels failure in FacetGrid (Seaborn 0.9.0)","user":{"login":"michaelsilverstein","id":22639569,"node_id":"MDQ6VXNlcjIyNjM5NTY5","avatar_url":"https://avatars0.githubusercontent.com/u/22639569?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelsilverstein","html_url":"https://github.com/michaelsilverstein","followers_url":"https://api.github.com/users/michaelsilverstein/followers","following_url":"https://api.github.com/users/michaelsilverstein/following{/other_user}","gists_url":"https://api.github.com/users/michaelsilverstein/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelsilverstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelsilverstein/subscriptions","organizations_url":"https://api.github.com/users/michaelsilverstein/orgs","repos_url":"https://api.github.com/users/michaelsilverstein/repos","events_url":"https://api.github.com/users/michaelsilverstein/events{/privacy}","received_events_url":"https://api.github.com/users/michaelsilverstein/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-10-29T16:32:53Z","updated_at":"2018-10-29T18:10:26Z","closed_at":null,"author_association":"NONE","body":"With previous version of Seaborn, I have been able to use `g.set_xtickslabels(rotation=90)` to rotate the shared x-axis of a FacetGrid; however, now passing the `rotation` argument alone removes the xticklabels. \r\n\r\nThe only way I was able to get the function to work properly was to also pass a list of labels: `g.set_xticklabels(labels, rotation=90)`, which is prone to errors. \r\n\r\nI can't tell the source for this behavior, the code suggests that the labels should be grabbed from the axes:\r\nhttps://github.com/mwaskom/seaborn/blob/f0349b1a7f1e022cb1da8b94f2e019f04eeed397/seaborn/axisgrid.py#L894"},"comment":{"url":"https://api.github.com/repos/mwaskom/seaborn/issues/comments/434019479","html_url":"https://github.com/mwaskom/seaborn/issues/1598#issuecomment-434019479","issue_url":"https://api.github.com/repos/mwaskom/seaborn/issues/1598","id":434019479,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDAxOTQ3OQ==","user":{"login":"michaelsilverstein","id":22639569,"node_id":"MDQ6VXNlcjIyNjM5NTY5","avatar_url":"https://avatars0.githubusercontent.com/u/22639569?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelsilverstein","html_url":"https://github.com/michaelsilverstein","followers_url":"https://api.github.com/users/michaelsilverstein/followers","following_url":"https://api.github.com/users/michaelsilverstein/following{/other_user}","gists_url":"https://api.github.com/users/michaelsilverstein/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelsilverstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelsilverstein/subscriptions","organizations_url":"https://api.github.com/users/michaelsilverstein/orgs","repos_url":"https://api.github.com/users/michaelsilverstein/repos","events_url":"https://api.github.com/users/michaelsilverstein/events{/privacy}","received_events_url":"https://api.github.com/users/michaelsilverstein/received_events","type":"User","site_admin":false},"created_at":"2018-10-29T18:10:26Z","updated_at":"2018-10-29T18:10:26Z","author_association":"NONE","body":"Generate some data\r\n```\r\nn = 5\r\nanimals = ['cat','dog','horse']\r\ngenders = ['male', 'female']\r\nstates = ['MA', 'NY']\r\n\r\ndf = pd.DataFrame([[a, g, s, np.random.randint(0, 10)] for _ in range(n) for a in animals for g in genders for s in states], columns=['animal', 'gender', 'state','n_friends'])\r\n```\r\n\r\nPlot FacetGrid and try to rotate\r\n```\r\ng = sns.FacetGrid(df, 'state')\r\norder = sorted(df.animal.unique())\r\ng.map(sns.barplot, 'animal', 'n_friends', 'gender', palette='Paired', order=order, hue_order=df.gender.unique())\r\ng.set_xticklabels(rotation=90)\r\nplt.show()\r\n```\r\n![image](https://user-images.githubusercontent.com/22639569/47670712-3ff53280-db84-11e8-9bca-79516929f355.png)\r\n\r\nPlot FacetGrid with labels provided\r\n```\r\ng = sns.FacetGrid(df, 'state')\r\norder = sorted(df.animal.unique())\r\ng.map(sns.barplot, 'animal', 'n_friends', 'gender', palette='Paired', order=order, hue_order=df.gender.unique())\r\ng.set_xticklabels(order, rotation=90)\r\nplt.show()\r\n```\r\n![image](https://user-images.githubusercontent.com/22639569/47670743-57ccb680-db84-11e8-8c8e-180ca3643929.png)\r\n"}}
{"actor":{"display_login":"michaelsilverstein"}}