代码如下
import numpy as np
import matplotlib.pyplot as plt
N = 5
y = [20,10,30,25,15]
index = np.arange(N)
pl = plt.bar(left=index,height=y)
plt.show()
运行后
pl = plt.bar(left=index,height=y)
TypeError: bar() missing 1 required positional argument: 'x'