Files
dump2sq/example/testplot.py
T
2022-03-12 18:23:22 +09:00

41 lines
1.0 KiB
Python
Executable File

#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
# total ND
fig, ax = plt.subplots(nrows=2, sharex=True)
d = np.loadtxt("test.sq")
ax[0].plot(d[:, 0], d[:, -1], "-", label="dump2sq")
d = np.loadtxt("rmcp_total_nd.sq")
ax[0].plot(d[:, 0], d[:, 1], "-", label="rmc")
ax[0].legend(loc="best")
# total XRD
d = np.loadtxt("test.sq")
ax[1].plot(d[:, 0], d[:, -2], "-", label="dump2sq")
d = np.loadtxt("rmcp_total_xrd.sq")
ax[1].plot(d[:, 0], d[:, 1], "-", label="rmc")
ax[1].legend(loc="best")
# ppcf
rmc = np.loadtxt("rmcp.ppcf")
dum = np.loadtxt("test.gr")
fig, ax = plt.subplots(nrows=rmc.shape[1]-1, sharex=True)
for i in range(1, rmc.shape[1]):
ax[i-1].plot(dum[:, 0], dum[:, i], label="dump2sq")
ax[i-1].plot(rmc[:, 0], rmc[:, i], label="rmp")
# ppcf
rmc = np.loadtxt("rmcp.psq")
dum = np.loadtxt("test.sq")
fig, ax = plt.subplots(nrows=rmc.shape[1]-1, sharex=True)
for i in range(1, rmc.shape[1]):
ax[i-1].plot(dum[:, 0], dum[:, i], label="dump2sq")
ax[i-1].plot(rmc[:, 0], rmc[:, i], label="rmp")
plt.show()