Skip to content

Instantly share code, notes, and snippets.

@balkian
Created November 8, 2015 18:19
Show Gist options
  • Save balkian/e654835d4263378a3ac8 to your computer and use it in GitHub Desktop.
Save balkian/e654835d4263378a3ac8 to your computer and use it in GitHub Desktop.
Matplotlib tricks
from matplotlib.pyplot import cm
color=cm.rainbow(np.linspace(0,1,len(emotions)))
color = dict(zip(emotions, color))
color
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
red_patch = mpatches.Patch(color='red', label='The red data')
plt.legend(handles=[red_patch])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment