From 04eaafc2934e925053aa449ee77d129d41229a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Sun, 8 Nov 2015 19:19:35 +0100 Subject: [PATCH] --- custom_palette.py | 4 ++++ customlabels.py | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 custom_palette.py create mode 100644 customlabels.py diff --git a/custom_palette.py b/custom_palette.py new file mode 100644 index 0000000..f83fcd3 --- /dev/null +++ b/custom_palette.py @@ -0,0 +1,4 @@ +from matplotlib.pyplot import cm +color=cm.rainbow(np.linspace(0,1,len(emotions))) +color = dict(zip(emotions, color)) +color \ No newline at end of file diff --git a/customlabels.py b/customlabels.py new file mode 100644 index 0000000..8df2512 --- /dev/null +++ b/customlabels.py @@ -0,0 +1,5 @@ +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]) \ No newline at end of file