Make ylim rendering dynamic
This commit is contained in:
parent
87f54c6fef
commit
bd804f1464
10
wsgi.py
10
wsgi.py
@ -151,7 +151,15 @@ def plot(
|
|||||||
|
|
||||||
plt.title("Teilnahme an Digitaler Beschäftigtenbefragung")
|
plt.title("Teilnahme an Digitaler Beschäftigtenbefragung")
|
||||||
plt.ylabel("# Teilnahmen")
|
plt.ylabel("# Teilnahmen")
|
||||||
plt.ylim(0, total_targets[0] + 100)
|
|
||||||
|
max_val = df.sum(axis=1).max().item()
|
||||||
|
|
||||||
|
nearest_target = np.array(total_targets, dtype=np.float32) - max_val
|
||||||
|
nearest_target[nearest_target <= 0] = np.inf
|
||||||
|
idx = np.argmin(nearest_target)
|
||||||
|
|
||||||
|
ceil_val = max(max_val, total_targets[idx])
|
||||||
|
plt.ylim(0, ceil_val * 1.025)
|
||||||
plt.legend()
|
plt.legend()
|
||||||
|
|
||||||
# use timezone offset to center tick labels
|
# use timezone offset to center tick labels
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user