joypy
joypy copied to clipboard
Creating subplots with joypy
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!
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 :)
Thanks @sbebo !
Hello bumping this older thread to see if @sbebo or @bluemonk482 or anyone else ever stumbled upon a solution for this!
Same problem with subplots. Is there an alternative way?