From f1cafc1eb177c618184385a1a6c31c6427520163 Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Fri, 26 Apr 2024 04:10:41 +0200 Subject: [PATCH] Improve `yticks` of `boxplot` in `flat-field_pointer.py` --- datasets/raise/flat-field_pointer.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/datasets/raise/flat-field_pointer.py b/datasets/raise/flat-field_pointer.py index a645e66..b3cb009 100644 --- a/datasets/raise/flat-field_pointer.py +++ b/datasets/raise/flat-field_pointer.py @@ -75,15 +75,18 @@ for xy, otherXy in zip(xys, xys[1:]): greatestDistance = distance greatestDistances += [greatestDistance] - +fig, ax = plt.subplots() plt.title('Distance between a wall marker location and the next one') -plt.boxplot(greatestDistances) +ax.boxplot(greatestDistances) + +ys = [] for percentile in [25, 50, 75]: y = np.percentile(greatestDistances, percentile) - plt.axhline(y = y) + ys += [y] + ax.axhline(y = y) -#plt.yticks() +ax.set_yticks(list(ax.get_yticks())[1:-1] + ys) -plt.xticks([], []) -plt.show() \ No newline at end of file +ax.set_xticks([], []) +fig.show() \ No newline at end of file