44 lines
953 B
Python
44 lines
953 B
Python
import json
|
|
|
|
import matplotlib.pyplot as plt
|
|
import numpy as np
|
|
from matplotlib.colors import hsv_to_rgb
|
|
|
|
plt.rcParams["figure.figsize"] = [18, 9]
|
|
plt.style.use("dark_background")
|
|
plt.subplots_adjust(left=0.05, right=0.99, top=0.95, bottom=0.05)
|
|
|
|
|
|
with open("metrics.json", "r") as file:
|
|
metrics = json.load(file)
|
|
entries = metrics["entries"]
|
|
cors = metrics["cors"]
|
|
|
|
|
|
def render_ploc():
|
|
X, Y, Ya, Yd = np.array(entries).transpose()
|
|
plt.clf()
|
|
plt.plot(X, Y)
|
|
plt.fill_between(X, Y, Y - Ya, alpha=0.5, color="green")
|
|
plt.fill_between(X, Y, Y + Yd, alpha=0.5, color="red")
|
|
plt.savefig("/code/metrics.png")
|
|
|
|
|
|
def render_cors():
|
|
N = len(cors[0])
|
|
X = np.arange(N)
|
|
Y = np.array(cors)
|
|
plt.clf()
|
|
C = N
|
|
plt.stackplot(
|
|
X,
|
|
Y,
|
|
colors=[hsv_to_rgb((i / C, 0.25, 0.75)) for i in range(C)],
|
|
aa=False,
|
|
)
|
|
plt.savefig("/code/metrics-cors.png")
|
|
|
|
|
|
render_ploc()
|
|
render_cors()
|