我就废话不多说了,直接上代码吧!
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
bar_positions=[1,2,3,4]
bar_heights=[1,2,3,4]
print(np.arange(len([2,2,3,4,5])+1))
ax.bar(np.arange(len([2,2,3,4,5])),[1,2,3,4,5], 0.5)#设置x,y数据,区间
ax.set_xticks([1,2,3,4,5,6])#设置x轴刻度
ax.
1