matplotlibを使用して棒グラフをプロットしようとしています。私の問題は、リストにいくつかの「0」の値があり、matplotlibがこれらの値のいくつかを食べることです。どのようにして、常にすべての値をプロットするようにしますか。
コードは次のとおりです。
counter_trim = counter[6:(len(counter)-6)]
pos = np.arange(len(Test_names[6:]))
width =.65
ax = plt.axes()
ax.set_ylabel('Number of failures')
ax.set_title('Distribution of ABT failures')
ax.set_xticks(pos + (width/2))
xtickNames= ax.set_xticklabels(Test_names[6:])
plt.setp(xtickNames, rotation=90, fontsize=10)
plt.bar(pos, counter_trim, width, color='b')
plt.tight_layout()
print 'Distribution plot can be found here:' +image_filepath
plt.savefig(image_filepath)
より明確にするために、
ここにposの値があります:[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16]
およびcounter_trimの値:[0、0、0、1、17、6、0、14、32、11、0、0、2、0、1、0、0]
上記のコードは最初の3つと最後の2つのゼロをスキップしますが、残りはすべて同じです!
これを回避する方法はありますか?