x和y必须具有相同的第一维,但是无论如何它都会显示图

时间:2018-06-22 17:08:48

标签: python matplotlib

所以我想为283个对象创建子图,这段代码可以做到这一点,但是在所有图的最后,它也给出了这个错误,并且也没有绘制最后的图。不能真正理解为什么。

j=df[sum_of_all_wf!=0]
d = np.linspace(1,6,6)
ran = np.arange(0,282,24)
for r in ran:
plt.figure(r,figsize=(15,200))
for i in range(r,r+24):
    a = j.iloc[i:i+1]
    x = np.concatenate([a['t11_arms_number_a31_1_weighted_fraction'],a['t11_arms_number_a32_2_weighted_fraction']
                        ,a['t11_arms_number_a33_3_weighted_fraction'],a['t11_arms_number_a34_4_weighted_fraction']
                        ,a['t11_arms_number_a36_more_than_4_weighted_fraction']
                        ,a['t11_arms_number_a37_cant_tell_weighted_fraction']])
    plt.subplot(100,4,i+1)
    plt.tight_layout()
    plt.plot(d,x)
    plt.title(i)

plt.show()

错误消息是     ValueError:x和y必须具有相同的第一尺寸,但形状为(6,)和(0,)

0 个答案:

没有答案