Use black marker instead of crashing on inputs with no label info.
authorTom Clegg <tom@tomclegg.ca>
Tue, 21 Apr 2020 22:20:40 +0000 (18:20 -0400)
committerTom Clegg <tom@tomclegg.ca>
Tue, 21 Apr 2020 22:20:40 +0000 (18:20 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

plot.go

diff --git a/plot.go b/plot.go
index 4941f6fe8b6d9e1bf7ac0db795af7da766de6804..5e2eb638454098f1e40019e67d4617f57b0cd6ad 100644 (file)
--- a/plot.go
+++ b/plot.go
@@ -116,7 +116,10 @@ if sys.argv[2]:
         'PJL': 'blueviolet',
     }
     for fnm in sorted(labels.keys()):
-        colors.append(labelcolors[labels[fnm]])
+        if labels[fnm] in labelcolors:
+            colors.append(labelcolors[labels[fnm]])
+        else:
+            colors.append('black')
 
 from matplotlib.figure import Figure
 from matplotlib.patches import Polygon