📜  如何在 matplotlib 上绘制条形图 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:35.854000             🧑  作者: Mango

代码示例1
import matplotlib.pyplot as plt 

data = [5., 25., 50., 20.]
plt.bar(range(len(data)),data)
plt.show()

// to set the thickness of a bar, we can set 'width'
// plt.bar(range(len(data)), data, width = 1.)