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

How to group/separate? #37

Closed
DeLaRiva opened this issue Jul 18, 2019 · 1 comment
Closed

How to group/separate? #37

DeLaRiva opened this issue Jul 18, 2019 · 1 comment

Comments

@DeLaRiva
Copy link

I exactly would like to create a plot like https://www.machinelearningplus.com/wp-content/uploads/2018/11/24_JoyPlot_joypy-min-1024x741.png found on https://www.machinelearningplus.com/plots/top-50-matplotlib-visualizations-the-master-plots-python/ , where they use fig, axes = joypy.joyplot(mpg, column=['hwy', 'cty'], by="class", ylim='own', figsize=(14,10))

To do so I use fig, ax = joypy.joyplot(Temperatures_df, by="Transformer", figsize=(14,7), linewidth=0.05,overlap=3,colormap=cm.OrRd_r)
but I receive the following:

plot

but I would like to have the variables separated and then each variable grouped by "Transformer". Hence, I tried fig, ax = joypy.joyplot(Temperatures_df, figsize=(14,7), linewidth=0.05,overlap=3, colormap=cm.OrRd_r) but then I receive:
plot1

What I am actually looking for is a combination of both of them. Respectively I don't understand why I can't create the same appearance like in the first image as this fulfills my expectations already.
Why is that?

The Temperatures_df looks like following:

BotTmp | EnvTmp | HPTmpClc | LTCTmp | Transformer
timestamp

2018-02-02 14:31:00 | NaN | NaN | 54.400000 | NaN | Transformer S1
2018-02-02 14:45:00 | NaN | NaN | 54.400000 | NaN | Transformer S1
2018-02-02 15:00:00 | NaN | NaN | 54.400000 | NaN | Transformer S1
(...)
2018-10-25 01:30:00 | NaN | NaN | NaN | 30.790190 | Transformer S2

@leotac
Copy link
Owner

leotac commented Sep 8, 2019

Hi,

not sure what is your expected result. I would suggest looking at the notebook with examples, in the last few examples (about colors).
Currently, if you use both the by and colormap argument, the same colormap is applied to all groups. This is why you obtain the result in the first figure. (Not sure this is the most sensible default indeed, but it's like this at the moment).

You should use the color argument and pass explicitly the colors, if you want each group to have a separate color, like this:

fig, axes = joypy.joyplot(iris,fill=True, legend=True, by="Name", color=["k","b","r","g"])

exam

You could even pass a list of different colormaps, where the list has the same length as the number of groups. You can find both examples in the notebook.

@leotac leotac closed this as completed Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants