Compare commits
3 Commits
72e38fab08
...
dev
Author | SHA1 | Date | |
---|---|---|---|
6ed3b50110 | |||
c1b07499c2 | |||
46079135b7 |
@ -29,7 +29,10 @@ groupings = [
|
||||
[2, 5, 8]
|
||||
]
|
||||
|
||||
# Folder wyjściowy (opcjonalnie)
|
||||
# Kolory z palety 'tab10'
|
||||
color_palette = plt.get_cmap('tab10')
|
||||
|
||||
# Folder wyjściowy
|
||||
output_folder = "plots"
|
||||
os.makedirs(output_folder, exist_ok=True)
|
||||
|
||||
@ -37,14 +40,28 @@ os.makedirs(output_folder, exist_ok=True)
|
||||
for i, group in enumerate(groupings):
|
||||
group_labels = [labels[j] for j in group]
|
||||
group_means = [means[j] for j in group]
|
||||
colors = [color_palette(j % 10) for j in group] # różne kolory
|
||||
|
||||
plt.figure()
|
||||
plt.bar(group_labels, group_means)
|
||||
bars = plt.bar(group_labels, group_means, color=colors)
|
||||
|
||||
# Oblicz maksymalną wartość, by zwiększyć wysokość osi Y
|
||||
max_val = max(group_means)
|
||||
plt.ylim(0, max_val * 1.15) # dodaj 15% zapasu na tekst
|
||||
|
||||
plt.ylabel("Średni czas wdrożenia (sek)")
|
||||
plt.title(f"Porównanie średnich czasów wdrożenia")
|
||||
plt.xticks(rotation=45)
|
||||
|
||||
# Dodanie wartości nad słupkami
|
||||
for bar in bars:
|
||||
yval = bar.get_height()
|
||||
label = f'{yval:.1f}'.replace('.', ',') # <-- tutaj zamiana kropki na przecinek
|
||||
plt.text(bar.get_x() + bar.get_width()/2.0, yval + max_val * 0.02, label,
|
||||
ha='center', va='bottom', fontsize=9)
|
||||
|
||||
plt.tight_layout()
|
||||
plt.savefig(f"{output_folder}/mean_times_{i}.png")
|
||||
plt.close()
|
||||
|
||||
print("Wykresy zapisane!")
|
||||
print("Wszystkie wykresy wygenerowane z dodatkowymi marginesami!")
|
||||
|
Reference in New Issue
Block a user