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]:
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]
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 [ ]: