Minor fix
This commit is contained in:
27
python_scripts/plot_v.py
Normal file
27
python_scripts/plot_v.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
import matplotlib
|
||||
from matplotlib.animation import FuncAnimation
|
||||
import ast
|
||||
|
||||
|
||||
def plot():
|
||||
with open("v.txt") as f:
|
||||
lines = f.readlines();
|
||||
size = int(lines[0])
|
||||
for line in lines[1:]:
|
||||
arr = line.strip().split("\t")
|
||||
arr = np.asarray(list(map(lambda x: ((a := complex(*ast.literal_eval(x)))*a.conjugate()).real, arr)))
|
||||
|
||||
# print(sum(arr))
|
||||
arr = arr.reshape(size,size)
|
||||
# print(arr)
|
||||
|
||||
plt.imshow(arr.T, cmap="hot", interpolation="nearest")
|
||||
plt.show()
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
plot()
|
||||
Reference in New Issue
Block a user