Spaces:
Sleeping
Sleeping
File size: 1,171 Bytes
bd39f54 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import *
from sklearn.preprocessing import label_binarize
from coding.llh.static.config import Config
def draw_momentum(df, p1_name, p2_name):
plt.figure(figsize=(10, 6))
plt.plot(
df.loc[:, "elapsed_time"].values,
df.loc[:, "p1_momentum_value"].values,
"-",
color=Config.COLORS_1[8],
alpha=0.5,
label=p1_name
)
plt.plot(
df.loc[:, "elapsed_time"].values,
df.loc[:, "p2_momentum_value"].values,
"-",
color=Config.COLORS_1[9],
alpha=0.5,
label=p2_name
)
plt.axhline(
y=0,
linestyle="--",
color="black",
alpha=0.5
)
plt.plot(
df.loc[:, "elapsed_time"].values,
df.loc[:, "p1_momentum_value_better"].values,
"-",
color=Config.COLORS_1[10],
alpha=0.7,
label="Degree of Superiority"
)
title = "Momentum"
# plt.title(title)
plt.xlabel("Elapsed time")
plt.ylabel("Momentum value")
plt.legend()
plt.savefig("./diagram/{}.png".format(title), dpi=300)
plt.show() |