Training plot is not appearing properly for keras model

I have data where I need to train it with X and Y. Traning part is done but when I want to plot the prediction and actual data, it is appearing with so many lines instead of showing just non-linear regression line.

model= Sequential()
model.add(Dense(7,input_dim=1, activation="tanh"))

optimizer=tf.keras.optimizers.Adam(learning_rate=0.001), metrics= 

plt.scatter(X, Y,edgecolors='g')
plt.plot(X, predict,'r')
plt.legend([ 'Predictated Y' ,'Actual Y'])

Please see the attached imageplotting image

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum