From 8d2af2eb69fceb7663f39af3307fff45ee636a45 Mon Sep 17 00:00:00 2001 From: Eero Vaher Date: Mon, 12 Dec 2022 23:37:48 +0100 Subject: DOC: Fix legend placement in `percentile` docs A plot is meant to demonstrate the different methods of estimating the percentile that `numpy.percentile()` supports, but previously the legend covered a large fraction of it. Now the legend is drawn next to the plot. --- numpy/lib/function_base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'numpy/lib') diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index 5e666c17e..0e9a26228 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -4185,7 +4185,8 @@ def percentile(a, xlabel='Percentile', ylabel='Estimated percentile value', yticks=a) - ax.legend() + ax.legend(bbox_to_anchor=(1.03, 1)) + plt.tight_layout() plt.show() References -- cgit v1.2.1