diff options
author | Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> | 2021-03-20 03:30:24 +0100 |
---|---|---|
committer | Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> | 2021-03-21 22:32:52 +0100 |
commit | bfb5e9f3450b5ecc19c1093b3f09e61037588ede (patch) | |
tree | ba8035daa3b1ac5348efac8a626aadd0ffe0c9d0 /numpy/lib/function_base.py | |
parent | f282603bf1c210e44ffc34e6a464c17a4851a58a (diff) | |
download | numpy-bfb5e9f3450b5ecc19c1093b3f09e61037588ede.tar.gz |
DOC: Update some plotting code to current Matplotlib idioms
- 3D Axes are created via add_subplot(projection='3d')
- There is now a `stairs()` function that's specifically designed for
showing histogram curves
- Labels should be passed as keyword arguments to the plot functions
instead of to `legend()`, which reduces the risk of mixing them up.
- ensure equal axis scaling in the meshgrid example
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r-- | numpy/lib/function_base.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index c6db42ce4..2586e3f62 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -4277,7 +4277,8 @@ def meshgrid(*xi, copy=True, sparse=False, indexing='xy'): >>> y = np.arange(-5, 5, 0.1) >>> xx, yy = np.meshgrid(x, y, sparse=True) >>> z = np.sin(xx**2 + yy**2) / (xx**2 + yy**2) - >>> h = plt.contourf(x,y,z) + >>> h = plt.contourf(x, y, z) + >>> plt.axis('scaled') >>> plt.show() """ |