摘要: x = np.linspace(1,10,25) y = (x-4)**2 index = random.sample(range(25),5) # 从1-24中不放回随机抽取5个数 y[index ] = [np.nan]*5 plt.plot(x,y,'o-') # 一定要保证x,y等长 plt.show()plt.plot(x,(x-4)**2,'x',x,y,'o-')pl... 阅读全文
posted @ 2018-04-29 20:19 chen狗蛋儿 阅读(498) 评论(0) 推荐(1) 编辑