File size: 937 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
import matplotlib.pyplot as plt


def draw_swings_and_positives(df, p1_name, p2_name):
    plt.figure(figsize=(10, 6))

    plt.plot(
        df.loc[:, "elapsed_time"].values,
        df.loc[:, "swing"].values,
        "-",
        color=Config.COLORS_2[2],
        alpha=0.7,
        label="Swing of Play"
    )
    plt.plot(
        df.loc[:, "elapsed_time"].values,
        df.loc[:, "p1_remain_positive"].values,
        "-.",
        color=Config.COLORS_2[0],
        alpha=0.7,
        label=p1_name
    )
    plt.plot(
        df.loc[:, "elapsed_time"].values,
        df.loc[:, "p2_remain_positive"].values,
        "-.",
        color=Config.COLORS_2[1],
        alpha=0.7,
        label=p2_name
    )

    title = "Standard time interval"
    # plt.title(title)

    plt.xlabel("Elapsed time")
    plt.ylabel("Standard time interval")
    plt.legend()

    plt.savefig("./diagram/{}.png".format(title), dpi=300)

    plt.show()