x = np.linspace(1,10,25) y = (x-4)**2 index = random.sample(range(25),5) #Randomly draw 5 numbers from 1-24 without replacement y[index ] = [np.nan]*5 plt.plot(x,y, ' o- ' ) #Make sure that x,y are of equal length plt.show()
plt.plot(x,(x-4)**2,'x',x,y, 'o-')
plt.show()