python plt x轴坐标按1刻度显示

    技术2022-07-16  69

    import matplotlib.pyplot as plt from matplotlib.pyplot import MultipleLocator x_major_locator = MultipleLocator(1) ax = plt.gca() ax.xaxis.set_major_locator(x_major_locator) # x轴按1刻度显示 # ls_num是你已有的列表数据,存放纵坐标内容 plt.plot(ls_num) # y轴变量 plt.ylabel('count') # y轴名字 plt.show()

    Processed: 0.012, SQL: 9