Skip to content

Instantly share code, notes, and snippets.

@kanzitelli
Created November 11, 2017 03:20
Show Gist options
  • Save kanzitelli/94e95d97c5331b48a2c761e1e85b17a0 to your computer and use it in GitHub Desktop.
Save kanzitelli/94e95d97c5331b48a2c761e1e85b17a0 to your computer and use it in GitHub Desktop.
aapl_amzn_dict = { 'AAPL': log_returns.AAPL, 'AMZN': log_returns.AMZN }
AAPL_AMZN_log_returns = pd.DataFrame.from_dict(aapl_amzn_dict)
fig = plt.figure(figsize=[16,9])
ax = fig.add_subplot(2,1,2)
for c in AAPL_AMZN_log_returns:
ax.plot(AAPL_AMZN_log_returns.index, 100*(np.exp(AAPL_AMZN_log_returns[c].cumsum()) - 1), label=str(c))
ax.set_ylabel('Total relative returns (%)')
ax.legend(loc='best')
ax.grid()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment