1
0
mirror of https://github.com/CovidBraceletPrj/CovidBracelet.git synced 2024-10-31 17:08:43 +01:00

Smaller tweaks for graphs

This commit is contained in:
Patrick Rathje 2022-08-03 15:18:05 +02:00
parent b9b60fe483
commit ee73e2d068
5 changed files with 4 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -195,7 +195,7 @@ def export_consumption_per_day():
bars = ax.bar(ys,xs) bars = ax.bar(ys,xs)
xs_labels = ["{:.2f}".format(x) if x >= 0.01 else "<0.01" for x in xs] xs_labels = ["{:.2f}".format(x) if x >= 0.01 else "<0.01" for x in xs]
ax.bar_label(bars, padding=3, labels=xs_labels) ax.bar_label(bars, padding=0, labels=xs_labels)
# Adapt the figure size as needed # Adapt the figure size as needed
@ -225,7 +225,7 @@ def export_usage_seconds_per_day():
bars = ax.bar(ys,xs) bars = ax.bar(ys,xs)
xs_labels = ["{:.2f}".format(x) if x >= 0.01 else "<0.01" for x in xs] xs_labels = ["{:.2f}".format(x) if x >= 0.01 else "<0.01" for x in xs]
ax.bar_label(bars, padding=3, labels=xs_labels) ax.bar_label(bars, padding=0, labels=xs_labels)
ax = plt.gca() ax = plt.gca()
#ax.set_xlim([xmin, xmax]) #ax.set_xlim([xmin, xmax])
@ -253,7 +253,7 @@ def export_current_per_functionality():
bars = ax.bar(ys,xs) bars = ax.bar(ys,xs)
xs_labels = ["{:.2f}".format(x) if x >= 0.01 else "<0.01" for x in xs] xs_labels = ["{:.2f}".format(x) if x >= 0.01 else "<0.01" for x in xs]
ax.bar_label(bars, padding=3, fmt='%.2f', labels=xs_labels) ax.bar_label(bars, padding=0, fmt='%.2f', labels=xs_labels)
# Adapt the figure size as needed # Adapt the figure size as needed
fig.set_size_inches(2.5, 2.75) fig.set_size_inches(2.5, 2.75)
@ -307,7 +307,7 @@ def export_tek_check():
bar_labels = [means['GAEN'][i]+means['TEK Transport'][i]+means['TEK Check'][i] for (i,x) in enumerate(xs)] bar_labels = [means['GAEN'][i]+means['TEK Transport'][i]+means['TEK Check'][i] for (i,x) in enumerate(xs)]
bar_labels = ['{:.2f}'.format(l) for l in bar_labels] bar_labels = ['{:.2f}'.format(l) for l in bar_labels]
print(bar_labels) print(bar_labels)
ax.bar_label(bars, padding=3, labels=bar_labels) ax.bar_label(bars, padding=0, labels=bar_labels)
ax.set_ylabel('Estimated Daily Consumption [mAh]') ax.set_ylabel('Estimated Daily Consumption [mAh]')
ax.set_xlabel('Number of TEKs per Day') ax.set_xlabel('Number of TEKs per Day')