I'm trying to create a handful of kernel plots using a parallel loop. The loop works when I use a bar chart, but goes awry when I use a kernel plot. I'm new to python so I assume I'm missing something pretty obvious - any suggestions? Thanks!
oh and len(schools) = 3
#the kernel plot
fig = plt.figure(facecolor='white')
gs1 = GridSpec(1,len(schools))
sp1 = [plt.subplot(gs1[0,i]) for i in range(len(schools))]
colors = ["red", "blue", "green"]
schools2 = [[data1....],[data2....],[data3......]]
for ax, i in zip(sp1, range(len(schools))):
ax = sns.kdeplot(schools2[i], bw=.5, color = colors[i], lw=1.8, vertical=True, alpha=.5)
.
#the bar plot
fig = plt.figure(facecolor='white')
gs1 = GridSpec(1,len(schools))
sp1 = [plt.subplot(gs1[0,i]) for i in range(len(schools))]
colors = ["red", "blue", "green"]
test = [1,2,3]
for ax, i in zip(sp1, range(3)):
ax.bar(1, test[i], color = colors[i])
sns.kdeplotwithsns.kdeplot(..., ax=ax)to control where the plot ends up.fig, axes = plt.subplots(1, 3)