Add bin/sawsim_plot_histogram_file.py and Histogram.plot().
[sawsim.git] / bin / sawsim_plot_histogram_file.py
diff --git a/bin/sawsim_plot_histogram_file.py b/bin/sawsim_plot_histogram_file.py
new file mode 100755 (executable)
index 0000000..25e2f96
--- /dev/null
@@ -0,0 +1,15 @@
+#!/usr/bin/env python
+
+from pysawsim.parameter_scan import HistogramMatcher
+
+
+if __name__ == '__main__':
+    import sys
+    
+    for histfile in sys.argv[1:]:
+        with open(histfile, 'r') as f:
+            histograms = HistogramMatcher._read_force_histograms(f)
+            for params,histogram in sorted(histograms.items()):
+                histogram.plot(
+                    title=params,
+                    filename='histogram{}.png'.format(params.replace(' ','_')))