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

Creating subplots with joypy #28

Open
bwang482 opened this issue Nov 16, 2018 · 4 comments
Open

Creating subplots with joypy #28

bwang482 opened this issue Nov 16, 2018 · 4 comments

Comments

@bwang482
Copy link

Thanks for the great library @Sbebo !!

I am struggling a little bit on dynamically creating subplot using joypy:

import joypy
import pandas as pd
from matplotlib import cm
import matplotlib.pyplot as plt

f, a = plt.subplots(2, 1)
data = pd.read_csv('../data.txt', sep="\t", header=None)

for c, i in enumerate(range(0, len(data), 50)):
    x_range = list(range(i, i+50, 1))
    fig, axes = joypy.joyplot(data[i:i+50], kind="values", x_range=x_range, colormap=cm.Set2,
                             figsize=(100,10))
    **a[c] = f.add_subplot(fig) # this is wrong! Though I can't figure out how to add joyplot as subplot to my figure..**
    a[c].set_xticks(x_range);

f.savefig('joyplot.png', bbox_inches='tight') 

Any suggestions would be appreciated! Thanks!

@leotac
Copy link
Owner

leotac commented Nov 20, 2018

Hi, and thank you for using it. Quick answer (don't have much time to reply now): as it's implemented, I'm afraid is not super easy to have multiple subplots. I would have to think a bit about it and experiment a bit. I'll try to get back to you, if I manage :)

@bwang482
Copy link
Author

Thanks @Sbebo !

@Acaravan
Copy link

Hello bumping this older thread to see if @Sbebo or @bluemonk482 or anyone else ever stumbled upon a solution for this!

@Shinibaig
Copy link

Same problem with subplots. Is there an alternative way?

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

4 participants