You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

plot_benchmarks.py 834B

123456789101112131415161718192021222324252627282930
  1. #! /usr/bin/env python
  2. """
  3. Plot benchmark files produced from Benchmark_RAW_File.
  4. Usage: python plot_benchmarks.py [benchmark file name].
  5. Example: python plot_benchmarks.py LiebLin_Rho_Rho_c_4_L_64_N_64_64_0__iK_32_raw.bmk
  6. """
  7. import matplotlib.pyplot as plt
  8. import numpy as np
  9. import sys
  10. filename = str(sys.argv[1])
  11. index, srcont = np.loadtxt(filename, usecols=(0,1), unpack=True)
  12. index_srt, srcont_srt = np.loadtxt(filename + '_srt', usecols=(0, 1), unpack=True)
  13. plt.semilogy(index, srcont, '.', markersize=1, label='Realized order')
  14. plt.semilogy(index, srcont_srt, '.', markersize=1, label='Ideal order') # careful: index, not index_srt
  15. plt.xlabel('Order')
  16. plt.ylabel('ln(ME)')
  17. plt.title('Comparison of realized and ideal order\n' + filename)
  18. plt.legend()
  19. plt.savefig(filename.replace('.', '_') + '_plot.png')
  20. plt.show()