Сначала у меня есть эти данные, и график в порядке
dic={'x': {0: '1', 1: '3', 2: '4', 3: '7', 4: '9', 5: '10', 6: '11', 7: '13', 8: '14', 9: '16'},
'y': {0: '0', 1: '0', 2: '0', 3: '1', 4: '0', 5: '1', 6: '1', 7: '1', 8: '1', 9: '1'}}
df = pd.DataFrame(dic)
plt.scatter(df["x"],df["y"])
Then I have these data and the plot is ok too
y2=np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1])
xsimul=np.linspace(0,16,200).reshape(-1,1)
plt.plot(xsimul,y2)
But when I try to create the two plots together in one figure
plt.plot(xsimul,y2)
plt.scatter(df["x"],df["y"])
I got this plot
введите описание изображения здесь
Что не так в моем коде?