python matplotlib 绘制制定范围np.array的图形

    xiaoxiao2022-07-07  190

    import numpy as np import matplotlib.pyplot as plt l1=[] with open(r"C:\Users\Administrator\Desktop\result.txt",“r”) as f: while True: s=f.readline() if s=="": break; l1.append(int(s)) x=np.arange(0,len(l1),1) y=np.array(l1) fig1=plt.figure(num=“Ex曲线”,figsize=(30,4)) plt.plot(x[0:2400],y[0:2400]) plt.show() plt.close()

    最新回复(0)