This code works fine for me. I guess you have not used proper quotes
import matplotlib.pyplot as plt predicted_stock_price = model.predict(X_test) predicted_stock_price = sc.inverse_transform(predicted_stock_price) # Visualising the results plt.plot(df.loc[800:, 'Date'],dataset_test.values, color = 'red', label = 'Real Price') plt.plot(df.loc[800:, 'Date'],predicted_stock_price, color = 'blue', label = 'Predicted Price') plt.xticks(np.arange(0,459,50))Here is the code and it run fine on my data and predictions.Although you can use matplotlib do make quite interactive plots.Check them out too