Python, Technology, Stock Market, Data Science, Machine Learning.
plt.legend() plt.show() def plot_portfolio(self, stock_data, portfolio): plt.scatter(stock_data['Volatility'], stock_data['Returns'], c='lightgray') plt.scatter(portfolio['Volatility'], portfolio['Returns'], color='red', marker='x', label='Portfolio') plt.xlabel('Volatility') plt.ylabel('Returns')