1
に複数の値を得た私は、Pythonを使用して、私のExcelのグラフのいずれかを再作成しようとしたが、継続的に今ハンガーノック:例外TypeError:バー()キーワード引数「高さ」
ここでは私の知る限り行くために管理してコードであります:
matplotlib.pyplot.bar(left, height, width=0.8, bottom=None, hold=None, data=None, **kwargs)
あなたがやっている:
import matplotlib.pyplot as plt
from numpy import arange
myfile = open('C:\Users\user\Desktop\Work In Prog\Alpha Data.csv', 'r')
label = [] # this is a string of the label
data = [] #this is some integer, some are the same value
for lines in myfile:
x = lines.split(',')
label.append(x[1])
data.append(x[4])
dataMin = float(min(data))
dataMax = float(max(data))
pos = arange(dataMin, dataMax, 1)
p1 = plt.bar(pos, data, color='red', height=1)
plt.show()
脇に、csvモジュールは検討する価値があります。 – Max