Add bin/sawsim_plot_histogram_file.py and Histogram.plot().
[sawsim.git] / bin / sawsim_plot_histogram_file.py
1 #!/usr/bin/env python
2
3 from pysawsim.parameter_scan import HistogramMatcher
4
5
6 if __name__ == '__main__':
7     import sys
8     
9     for histfile in sys.argv[1:]:
10         with open(histfile, 'r') as f:
11             histograms = HistogramMatcher._read_force_histograms(f)
12             for params,histogram in sorted(histograms.items()):
13                 histogram.plot(
14                     title=params,
15                     filename='histogram{}.png'.format(params.replace(' ','_')))