Am using following code to print to plot stock prices and a vertical line on one graph. But of them work individually but i cant plot both on one graph
import datetime as dt
import yfinance as yf
import matplotlib.pyplot as plt
# Get the data for the stock Apple by specifying the stock ticker, start date, and end date
data = yf.download('AAPL','2020-02-01','2020-02-10', interval='15m')
data.Close.plot(figsize=(10, 5))
plt.axvline(dt.datetime(2020, 2, 2)) ## No effect if previous line is there.
plt.show()
The vertical line is shown only if i comment data.Close.plot(figsize=(10, 5)) line