Skip to content

Instantly share code, notes, and snippets.

@ken333135
Created June 17, 2019 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ken333135/49143a55a2cdc40c991b2a9e1fa6c4f3 to your computer and use it in GitHub Desktop.
Save ken333135/49143a55a2cdc40c991b2a9e1fa6c4f3 to your computer and use it in GitHub Desktop.
# set colors
cmap=['white','red','orange','yellow','green','blue',
'indigo','violet','purple','grey','pink',
'brown','black']
f, ax = plt.subplots(figsize=(6, 18))
# drop duplicates for bookDf **End of book A is the start of book B
df = bookDf.copy()
df.drop_duplicates(['Date'],inplace=True)
df = df.pivot('Week_num','DOW_num','color_proxy')
sns.heatmap(df, linewidths=.5,
ax=ax,
cmap=cmap,
cbar=False,
vmin = 0,
vmax = 12,
square = True,
yticklabels = y_ticklabels)
ax.set_yticklabels(ax.get_yticklabels(),rotation=0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment