I am trying to display a plot on the HTML page. How can I insert this plot inside an Html.DiV(). I tried but it gave me an error.
import pandas as pd
import yfinance as yf
import matplotlib.pyplot as plt
import pyfolio as pf
ticker='AAPL'
tickers_list = [ticker]
data = pd.DataFrame(columns=tickers_list)
for ticker in tickers_list:
data[ticker] = yf.download(ticker, period='10y',)['Adj Close']
data = data.pct_change().dropna().mean(axis=1)
data.head()
fig, ax = plt.subplots()
pf.plot_monthly_returns_dist(data)