diff Tryp_V.py @ 3:4432e4183ebd draft

planemo upload for repository https://github.com/johnheap/VAPPER-Galaxy
author johnheap
date Wed, 11 Jul 2018 08:58:14 -0400
parents 36cb22bd911d
children e75a85590041
line wrap: on
line diff
--- a/Tryp_V.py	Tue Jul 10 09:22:53 2018 -0400
+++ b/Tryp_V.py	Wed Jul 11 08:58:14 2018 -0400
@@ -183,17 +183,16 @@
     col = cg.ax_col_dendrogram.get_position()
     cg.ax_col_dendrogram.set_position([col.x0, col.y0*1.08, col.width, col.height*1.1])
 
-
+    countryList = pd.unique(geo_df['Location'])
+    colourList = pd.unique(geo_df['colour'])
     legend_elements = [Patch(facecolor='orangered', label='COG Present'),
-                       Patch (facecolor='skyblue', label='COG Absent'),
-                       Patch(facecolor='w', label=''),
-                       Patch (facecolor='b', label='Nigeria'),
-                       Patch(facecolor = 'g', label='Uganda'),
-                       Patch (facecolor='c', label='Gambia'),
-                       Patch (facecolor='r', label='Ivory Coast'),
-                       Patch(facecolor='m', label='Brazil'),
-                       Patch(facecolor='k', label=name)]
-    #legend_test = [[Patch(facecolor='orangered'),Patch(facecolor='r')],["test","test2"]]
+                       Patch(facecolor='skyblue', label='COG Absent')]
+
+    for i in range(0, len(colourList)):
+        print("country = %s, colour = %s" % (countryList[i], colourList[i]))
+        p = Patch(facecolor=str(colourList[i]), label=countryList[i])
+        legend_elements.append(p)
+
     ax.legend(handles = legend_elements, bbox_to_anchor=(-0.3,1.2),loc = 'upper left')