This repository has been archived on 2025-02-02. You can view files and clone it, but cannot push or open issues or pull requests.
Files_for_MM/stability-plot.py
2025-01-26 21:49:59 +08:00

24 lines
766 B
Python

import json
import numpy as np
import matplotlib.pyplot as plt
colorList = json.load(open('color/config.json','r'))["color"]
import csv
with open('stability.csv', 'r') as f:
reader = csv.reader(f)
header = next(reader)
# next(reader)
data = [row for row in reader]
plt.figure(figsize=(6,5))
plt.bar(range(len(data)), [np.log(np.abs(float(row[2]))) for row in data] , color=colorList[0])
plt.plot([-1,len(data)],[0,0],color=colorList[2]) # x axis
plt.margins(0.01)
plt.xticks(range(0,len(data)), [row[3] for row in data], rotation=45)
plt.xlabel('Parameters abbr.',labelpad=-3)
plt.ylabel('Affect on Stability (log scale)')
plt.title('Different Parameters\'s Affect on Stability')
plt.savefig('result/stability-result.png',dpi=1024)
plt.show()