<jupyter_start><jupyter_text>Plotting<jupyter_code># Save the plot separately
plot_location = os.path.join(os.getcwd(), '..', 'Plots', 'Factor_Portfolio')
fig, ax = plt.subplots(1,1, figsize=(14, 7))

country = 'USA'
po_dict[country].plot_log_cum_returns(ax, start_time='1996-01-01')
ax.set_title('(%s) Optimal Pick Strategy Performance'% country,
             fontsize=14, fontweight=700)

fig.savefig(os.path.join(plot_location, 'portfolio_optimal_%s.pdf' % country),
            bbox_inches='tight')
fig, ax = plt.subplots(1,1, figsize=(14, 7))

country = 'Europe'
po_dict[country].plot_log_cum_returns(ax)
ax.set_title('(%s) Optimal Pick Strategy Performance'% country,
             fontsize=14, fontweight=700)

fig.savefig(os.path.join(plot_location, 'portfolio_optimal_%s.pdf' % country),
            bbox_inches='tight')
fig, ax = plt.subplots(1,1, figsize=(14, 7))

country = 'JPN'
po_dict[country].plot_log_cum_returns(ax)
ax.set_title('(%s) Optimal Pick Strategy Performance'% country,
             fontsize=14, fontweight=700)

fig.savefig(os.path.join(plot_location, 'portfolio_optimal_%s.pdf' % country),
            bbox_inches='tight')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15495342929720576, 'fraction_numerical': 0.03217612193056731, 'mean_word_length': 5.221052631578948, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '271046', 'license': 'MIT', 'n_tokens_mistral': 471, 'n_tokens_neox': 437, 'n_words': 70, 'path': 'Prediction/03_construct_optimal_portfolio.ipynb', 'repo_name': 'amritprasad/MFE_DAM', 'size': '1181'}