You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
plt.figure()
plt.plot(df["dowJones"], color='pink') # The line color (and many other properties) can be customizedplt.xlabel("Time index")
plt.ylabel("Return")
plt.show()
Simple scatterplot with legends
plt.figure()
plt.xlabel("Volatility")
plt.ylabel("Return")
# Plot stock values as scatter (eg std and return in this example)plt.scatter(df_stocks_std.values, df_stocks_returns.values, color='black', label='Nasdaq')
# Plot a line, as dotsplt.plot(myLine_std, myLine_return, color='green', linestyle='--', label='Some line')
# Highlight a point '*' markerplt.scatter(pointStdValue, pointReturnValue, color='red', marker='*', s=100, label='My special point')
plt.legend()
plt.show()
# In the plt statement# linestyle = 'solid' # https://matplotlib.org/stable/gallery/lines_bars_and_markers/linestyles.html# marker = 'o', # https://matplotlib.org/stable/api/markers_api.html# markerfacecolor = 'red'# markersize = 12