changeset 45:74d2de078baf

added colors, linestyles and markers to pick from
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Fri, 06 Aug 2010 01:09:44 -0400
parents be3ae926e4e8
children b5d007612e16
files python/utils.py
diffstat 1 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/python/utils.py	Sat Jul 31 23:39:17 2010 -0400
+++ b/python/utils.py	Fri Aug 06 01:09:44 2010 -0400
@@ -8,7 +8,7 @@
 
 __metaclass__ = type
 
-commentChar = '#';
+commentChar = '#'
 
 #########################
 # simple statistics
@@ -114,6 +114,23 @@
     return result
 
 #########################
+# plotting section
+#########################
+
+class PlottingPropertyValues:
+    def __init__(self, values):
+        self.values = values
+
+    def get(self,i):
+        return self.values[i%len(self.values)]
+
+markers = PlottingPropertyValues(['+', '*', ',', '.', 'x', 'D', 's', 'o'])
+
+linestyles = PlottingPropertyValues(['-', '--', '-.', ':'])
+
+colors = PlottingPropertyValues('brgmyck') # 'w'
+
+#########################
 # file I/O section
 #########################