summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-03-21 19:34:55 +0000
committerGitHub <noreply@github.com>2017-03-21 19:34:55 +0000
commit71a12bdd037de1f1c2d016d373982c27f6f58110 (patch)
treeaa44a63a66c078c2fdd2d901a2cc402cab7455af /numpy/lib
parentbdbd774af41e1a3480f86da932d8875bcf8eb145 (diff)
parent9f7a9e00eec6f0a795c859ff8328a6b82603e506 (diff)
downloadnumpy-71a12bdd037de1f1c2d016d373982c27f6f58110.tar.gz
Merge pull request #8799 from kl3n1nz/patch-1
DOC: Include np. prefix in meshgrid examples
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/function_base.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 0903790bd..cc0e8feeb 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -4601,12 +4601,12 @@ def meshgrid(*xi, **kwargs):
'xy' indexing and (M, N, P) for 'ij' indexing. The difference is
illustrated by the following code snippet::
- xv, yv = meshgrid(x, y, sparse=False, indexing='ij')
+ xv, yv = np.meshgrid(x, y, sparse=False, indexing='ij')
for i in range(nx):
for j in range(ny):
# treat xv[i,j], yv[i,j]
- xv, yv = meshgrid(x, y, sparse=False, indexing='xy')
+ xv, yv = np.meshgrid(x, y, sparse=False, indexing='xy')
for i in range(nx):
for j in range(ny):
# treat xv[j,i], yv[j,i]
@@ -4625,14 +4625,14 @@ def meshgrid(*xi, **kwargs):
>>> nx, ny = (3, 2)
>>> x = np.linspace(0, 1, nx)
>>> y = np.linspace(0, 1, ny)
- >>> xv, yv = meshgrid(x, y)
+ >>> xv, yv = np.meshgrid(x, y)
>>> xv
array([[ 0. , 0.5, 1. ],
[ 0. , 0.5, 1. ]])
>>> yv
array([[ 0., 0., 0.],
[ 1., 1., 1.]])
- >>> xv, yv = meshgrid(x, y, sparse=True) # make sparse output arrays
+ >>> xv, yv = np.meshgrid(x, y, sparse=True) # make sparse output arrays
>>> xv
array([[ 0. , 0.5, 1. ]])
>>> yv
@@ -4643,7 +4643,7 @@ def meshgrid(*xi, **kwargs):
>>> x = np.arange(-5, 5, 0.1)
>>> y = np.arange(-5, 5, 0.1)
- >>> xx, yy = meshgrid(x, y, sparse=True)
+ >>> 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)