1、示例 1
import numpy as np
import matplotlib.pyplot as plt
# 生成数据
v1 = np.random.randint(0, 13, 7)
plt.bar(list(range(7)), v1)
plt.show()
图形
2、pandas 绘图
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# 生成数据
y = np.random.randint(0, 13, 7)
y = pd.DataFrame(y, columns=['v'])
y.plot(kind='bar', color='k')
plt.show()
图形
。。。