Last active
April 22, 2019 00:57
-
-
Save Skanda319/54e828d54c1074c1a8b33580c87e2823 to your computer and use it in GitHub Desktop.
This file contains 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
sns.set(font_scale=1.5) | |
states = (pd.DataFrame(hidden_states, columns=['states'], index=X_test.index) | |
.join(X_test, how='inner') | |
.reset_index(drop=False) | |
.rename(columns={'index':'Date'})) | |
states.head() | |
#suppressing warnings because of some issues with the font package | |
#in general, would not rec turning off warnings. | |
import warnings | |
warnings.filterwarnings("ignore") | |
sns.set_style('white', style_kwds) | |
order = [0, 1, 2] | |
fg = sns.FacetGrid(data=states, hue='states', hue_order=order, | |
palette=colors, aspect=1.31, height=12) | |
fg.map(plt.scatter, 'date', "close", alpha=0.8).add_legend() | |
sns.despine(offset=10) | |
fg.fig.suptitle('Historical SPY Regimes', fontsize=24, fontweight='demi') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment