diff options
| author | mjkwiatkowski <mati.rewa@gmail.com> | 2026-06-26 13:33:10 +0200 |
|---|---|---|
| committer | mjkwiatkowski <mati.rewa@gmail.com> | 2026-06-26 13:33:10 +0200 |
| commit | 00945a67f551b90c528438bd24b6573abe603050 (patch) | |
| tree | b43025d097a9c70191f570720d993b24a8fcb00b /results/src/experiment3/plots.py | |
| parent | 15a3d5c6f55bec4a39f81f127dd1feec9660ecdc (diff) | |
Diffstat (limited to 'results/src/experiment3/plots.py')
| -rw-r--r-- | results/src/experiment3/plots.py | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/results/src/experiment3/plots.py b/results/src/experiment3/plots.py new file mode 100644 index 00000000..6dcf48f6 --- /dev/null +++ b/results/src/experiment3/plots.py @@ -0,0 +1,62 @@ +import numpy as np +import matplotlib.pyplot as plt +from matplotlib.pyplot import figure +import time +from time import strftime, gmtime + + +def get_name() -> str: + + curr = time.time() + s = strftime("%d_%b_%Y_%H%M%S", gmtime(curr)) + return s + + +width = 0.4 + + +kernels = ["Gmail", "WhatsApp", "Youtube", "Twitter", "Facebook"] + +x = np.arange(5) +values = (8.13, 4.15, 10.06, 16.75, 18.84) + +print(values) + +# Standard deviations (error values) +# errors = [np.std(poly), np.std(rbf), np.std(sigmoid)] +# errors2 = [np.std(baseline_poly), np.std(baseline_rbf), np.std(baseline_sigmoid)] +# print(errors) +# print(errors2) + +# Create bar chart with error bars +fig, ax = plt.subplots() +# plt.bar(x-0.22, values, width, yerr=errors, capsize=8, color='moccasin', edgecolor='black', label='Sunfish') +# plt.bar(x+0.22,values2, width, yerr=errors2, capsize=8, color='slategrey', edgecolor='black', label='OpenDC') + + +plt.bar( + x, + values, + width, + capsize=8, + color="thistle", + edgecolor="black", + label="Red + Yellow Alarms / Total Failures", +) + +# Add labels and title +plt.xlabel("Mean Failure Intensity (Trace)", fontweight="bold", size=10) +plt.ylabel("Failures Detection Rate", fontweight="bold", size=10) +loc = range(len(kernels)) +labels = kernels +plt.xticks(loc, kernels, size=10) +plt.grid(True, color="lightgray", linewidth=1, linestyle="-.") + + +plt.legend(fontsize=10, loc="upper left") +plt.yticks(size=10) +# ax.set_yscale("log") + +# Show plot +location: str = "figures/%s.pdf" % get_name() +plt.savefig(location, dpi=300, bbox_inches="tight") |
