File: plot_h2o.py

package info (click to toggle)
gpaw 25.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 18,888 kB
  • sloc: python: 174,804; ansic: 17,564; cpp: 5,668; sh: 972; csh: 139; makefile: 45
file content (33 lines) | stat: -rw-r--r-- 983 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# web-page: water.png
import matplotlib.pyplot as plt
import numpy as np

# Data from wm_dm_vs_scf.py
calculated_data = np.genfromtxt('water-results.txt')

# x should be number of water molecules.
# First column is number of atoms, so divide by 3 to
# obtain the number of water molecules.
x = calculated_data[:, 0] / 3

f = plt.figure(figsize=(12, 4), dpi=240)

plt.subplot(121)
plt.grid(color='k', linestyle=':', linewidth=0.3)
plt.title('Ratio of total elapsed times')
plt.ylabel(r'$T_{scf}$ / $T_{etdm}$')
plt.xlabel('Number of water molecules')
plt.ylim(1.0, 3.0)
plt.yticks(np.arange(1, 3.1, 0.5))
plt.plot(x, calculated_data[:, 1], 'bo-')

plt.subplot(122)
plt.grid(color='k', linestyle=':', linewidth=0.3)
plt.title('Ratio of elapsed times per iteration')
plt.ylabel(r'$T_{scf}$ / $T_{etdm}$')
plt.xlabel('Number of water molecules')
plt.ylim(1.0, 3.0)
plt.yticks(np.arange(1, 3.1, 0.5))
plt.plot(x, calculated_data[:, 2], 'ro-')

f.savefig("water.png", bbox_inches='tight')