summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
authorEero Vaher <eero.vaher@astro.lu.se>2022-12-12 23:37:48 +0100
committerEero Vaher <eero.vaher@astro.lu.se>2022-12-12 23:37:48 +0100
commit8d2af2eb69fceb7663f39af3307fff45ee636a45 (patch)
treec789f2a3b42bbea7aaffa75ee95bb80b735299ad /numpy/lib/function_base.py
parenta24ddad5d1d43ec9bea474abf8068ee6b8db01db (diff)
downloadnumpy-8d2af2eb69fceb7663f39af3307fff45ee636a45.tar.gz
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.
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py3
1 files changed, 2 insertions, 1 deletions
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