File mplot/mgraph.py changed (mode: 100644) (index 0a6661b..e6b67b9) |
13 |
13 |
|
|
14 |
14 |
#č sehnaní datarámu necháme uživateli |
#č sehnaní datarámu necháme uživateli |
15 |
15 |
def tri_estimation_fill(ax, df): |
def tri_estimation_fill(ax, df): |
16 |
|
# some default values |
|
17 |
|
if not ax.get_xlabel(): |
|
18 |
|
ax.set_xlabel('Number of simulations') |
|
19 |
|
if not ax.get_ylabel(): |
|
20 |
|
ax.set_ylabel('Probability measure') |
|
21 |
|
|
|
22 |
16 |
#xkcd_green = (167, 255, 181) # xkcd:light seafoam green #a7ffb5 |
#xkcd_green = (167, 255, 181) # xkcd:light seafoam green #a7ffb5 |
23 |
17 |
green = "#A7FFB5" |
green = "#A7FFB5" |
24 |
18 |
#xkcd_red = (253, 193, 197) # xkcd: pale rose (#fdc1c5) |
#xkcd_red = (253, 193, 197) # xkcd: pale rose (#fdc1c5) |
|
... |
... |
def tri_estimation_fill(ax, df): |
36 |
30 |
return ax.stackplot(df.index, f, m, o, s, labels=labels, colors=colors) |
return ax.stackplot(df.index, f, m, o, s, labels=labels, colors=colors) |
37 |
31 |
|
|
38 |
32 |
|
|
|
33 |
|
|
|
34 |
|
|
39 |
35 |
#č sehnaní datarámu necháme uživateli |
#č sehnaní datarámu necháme uživateli |
40 |
36 |
# inverted |
# inverted |
41 |
37 |
def trii_estimation_fill(ax, df): |
def trii_estimation_fill(ax, df): |
42 |
|
# some default values |
|
43 |
|
if not ax.get_xlabel(): |
|
44 |
|
ax.set_xlabel('Number of simulations') |
|
45 |
|
if not ax.get_ylabel(): |
|
46 |
|
ax.set_ylabel('Probability measure') |
|
47 |
|
|
|
48 |
38 |
#xkcd_green = (167, 255, 181) # xkcd:light seafoam green #a7ffb5 |
#xkcd_green = (167, 255, 181) # xkcd:light seafoam green #a7ffb5 |
49 |
39 |
green = "#A7FFB5" |
green = "#A7FFB5" |
50 |
40 |
#xkcd_red = (253, 193, 197) # xkcd: pale rose (#fdc1c5) |
#xkcd_red = (253, 193, 197) # xkcd: pale rose (#fdc1c5) |
|
... |
... |
def trii_estimation_fill(ax, df): |
62 |
52 |
return ax.stackplot(df.index, o, f, m, s, labels=labels, colors=colors) |
return ax.stackplot(df.index, o, f, m, s, labels=labels, colors=colors) |
63 |
53 |
|
|
64 |
54 |
|
|
|
55 |
|
#č ok, tak uděláme všecko dohromady |
|
56 |
|
#č datarám, jako vždy, uživatel donese svůj vlastní |
|
57 |
|
def tri_estimation_plot(ax, df, pf_exact=None, pf_exact_method="$p_f$"): |
|
58 |
|
# some default values |
|
59 |
|
# if not ax.get_xlabel(): |
|
60 |
|
# ax.set_xlabel('Number of simulations') |
|
61 |
|
# if not ax.get_ylabel(): |
|
62 |
|
# ax.set_ylabel('Probability measure') |
|
63 |
|
|
|
64 |
|
# fill |
|
65 |
|
tri_estimation_fill(ax, df) |
|
66 |
|
|
|
67 |
|
if pf_exact is not None: |
|
68 |
|
ax.axhline(pf_exact, c='b', label=pf_exact_method) |
|
69 |
|
|
|
70 |
|
#č teď čáry |
|
71 |
|
v = df['vertex_estimation'].to_numpy() |
|
72 |
|
wv = df['weighted_vertex_estimation'].to_numpy() |
|
73 |
|
ax.plot(df.index, v, '-m', label="simple $p_f$ estimation") |
|
74 |
|
ax.plot(df.index, wv, '-r', label="weighted $p_f$ estimation") |
|
75 |
|
|
|
76 |
|
|
|
77 |
|
|
65 |
78 |
|
|
66 |
79 |
#č ok, tak uděláme všecko dohromady |
#č ok, tak uděláme všecko dohromady |
67 |
80 |
#č datarám, jako vždy, uživatel donese svůj vlastní |
#č datarám, jako vždy, uživatel donese svůj vlastní |
68 |
81 |
def trii_estimation_plot(ax, df, pf_exact=None, pf_exact_method="$p_f$"): |
def trii_estimation_plot(ax, df, pf_exact=None, pf_exact_method="$p_f$"): |
|
82 |
|
# some default values |
|
83 |
|
# if not ax.get_xlabel(): |
|
84 |
|
# ax.set_xlabel('Number of simulations') |
|
85 |
|
# if not ax.get_ylabel(): |
|
86 |
|
# ax.set_ylabel('Probability measure') |
69 |
87 |
# fill |
# fill |
70 |
88 |
trii_estimation_fill(ax, df) |
trii_estimation_fill(ax, df) |
71 |
89 |
|
|