24 lines
501 B
Python
24 lines
501 B
Python
|
import matplotlib.pyplot as plt
|
||
|
import numpy as np
|
||
|
import sys
|
||
|
import os
|
||
|
|
||
|
def plot_error(dir):
|
||
|
# q | I_data | err | I_fit
|
||
|
data = np.genfromtxt(os.path.join(dir, "POPC-test.fit"))
|
||
|
|
||
|
plt.loglog(data[:,0], data[:, 1], ".", label="I_data")
|
||
|
plt.loglog(data[:,0], data[:, 3], label="I_fit")
|
||
|
|
||
|
plt.legend()
|
||
|
|
||
|
plt.show()
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
if len(sys.argv) > 1 and os.path.isdir(sys.argv[1]):
|
||
|
dir = sys.argv[1]
|
||
|
else:
|
||
|
dir = "POPC-test"
|
||
|
|
||
|
plot_error(dir)
|