Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KDE, pandas, and hue #595

Closed
TDaltonC opened this issue Jun 11, 2015 · 3 comments · Fixed by #2104
Closed

KDE, pandas, and hue #595

TDaltonC opened this issue Jun 11, 2015 · 3 comments · Fixed by #2104
Labels

Comments

@TDaltonC
Copy link

Coming from R and ggplot(), I have repeatedly found myself wanting to write this:

sns.kdeplot(data = DateFrame, x = 'column1', hue = 'column2')

expecting to get something like one of these.

And then I look through the docs to see what I actually have to do to get a plot that looks like that and it seems very cumbersome. Not at all what I would want from a quick-plot/data-exploration tool.

Is this a syntax that you would be interested in supporting or is there something deeply un-seaborn about it?

@TomAugspurger
Copy link
Contributor

@TDaltonC FYI I'll typically do something like

gr = df.groupby('column2').column1
for label, arr in gr:
    sns.kdeplot(arr, label=label, shade=True

which isn't too bad.

@mwaskom
Copy link
Owner

mwaskom commented Jun 12, 2015

Yes something like this will probably happen, depending on how upset people get about the changes to the categorical plots in 0.6.

In addition to Tom's code, you could also do

sns.FacetGrid(data, hue="column2").map(sns.kdeplot, "column1")

Which is kind of even more ggplotty.

@mwaskom
Copy link
Owner

mwaskom commented Jun 2, 2020

Closed in #2104 with the addition of hue to kdeplot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants