Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save quantra-go-algo/4d18a274d19fd4b6b9f2e2230f0c21e3 to your computer and use it in GitHub Desktop.
Save quantra-go-algo/4d18a274d19fd4b6b9f2e2230f0c21e3 to your computer and use it in GitHub Desktop.
# Set the figure size
plt.figure(figsize=(15,7))
# Plot both the benchmark and strategy returns
plt.plot(df_results.index, df_results['Benchmark'], label = "Benchmark Cumulative Returns")
plt.plot(df_results.index, df_results['Stra_cum_returns'], label = "Strategy Returns", color='g')
# Set the title of the graph
plt.title('Benchmark and Strategy Cumulative Returns using a 1-year span', fontsize=16)
# Set the x- and y- axis labels and ticks sizes
plt.xlabel('Year-Month', fontsize=15)
plt.ylabel('Cumulative Retunrs', fontsize=15)
plt.tick_params(axis='both', labelsize=15)
# Set the plot legend location
plt.legend(loc=2, prop={'size': 15}, bbox_to_anchor=(0,0.2))
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment