In [2]:
import numpy as np
%matplotlib inline
from matplotlib import pyplot as plt

In [3]:
np.meshgrid?

In [12]:
a=np.array(range(1,5))
b=np.array(range(6,10))

In [13]:
np.meshgrid(a,b)


Out[13]:
[array([[1, 2, 3, 4],
        [1, 2, 3, 4],
        [1, 2, 3, 4],
        [1, 2, 3, 4]]), array([[6, 6, 6, 6],
        [7, 7, 7, 7],
        [8, 8, 8, 8],
        [9, 9, 9, 9]])]

In [ ]:


In [6]:
xv, yv = 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')
for i in range(nx):
    for j in range(ny):
        # treat xv[j,i], yv[j,i]


  File "<ipython-input-6-cdb3aeda63ef>", line 6
    xv, yv = meshgrid(x, y, sparse=False, indexing='xy')
                                                        ^
IndentationError: expected an indented block

In [10]:
x = np.arange(-5, 5, 0.1)
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.contour(x,y,z)



In [11]:
plt.contour?

In [ ]: