123456789101112131415161718192021222324252627282930 |
- #! /usr/bin/env python
-
- """
- Plot benchmark files produced from Benchmark_RAW_File.
-
- Usage: python plot_benchmarks.py [benchmark file name].
-
- Example: python plot_benchmarks.py LiebLin_Rho_Rho_c_4_L_64_N_64_64_0__iK_32_raw.bmk
- """
-
- import matplotlib.pyplot as plt
- import numpy as np
- import sys
-
- filename = str(sys.argv[1])
-
- index, srcont = np.loadtxt(filename, usecols=(0,1), unpack=True)
- index_srt, srcont_srt = np.loadtxt(filename + '_srt', usecols=(0, 1), unpack=True)
-
- plt.semilogy(index, srcont, '.', markersize=1, label='Realized order')
- plt.semilogy(index, srcont_srt, '.', markersize=1, label='Ideal order') # careful: index, not index_srt
-
- plt.xlabel('Order')
- plt.ylabel('ln(ME)')
- plt.title('Comparison of realized and ideal order\n' + filename)
- plt.legend()
-
- plt.savefig(filename.replace('.', '_') + '_plot.png')
-
- plt.show()
|