Last active
April 30, 2024 16:06
-
-
Save quantra-go-algo/4d18a274d19fd4b6b9f2e2230f0c21e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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