In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np

In [2]:
l =4
N =100
x = np.linspace(0,l,N)
y = np.linspace(0,l,N)
X,Y = np.meshgrid(x,y)

In [6]:



Out[6]:


In [10]:
f = np.sin(X**2+Y**2)
#f[ (X-2)**2+(Y-2)**2<1 ] = -1
plt.imshow(f)


Out[10]:
<matplotlib.image.AxesImage at 0x7f6e4de36790>

In [4]:
plt.plot(Y[:,12],f[:,12])


Out[4]:
[<matplotlib.lines.Line2D at 0x7f6e4def8e10>]

In [5]:
a = np.array(range(5))

In [6]:
a


Out[6]:
array([0, 1, 2, 3, 4])

In [7]:
L = np.array([True,False,True,False,False])

In [8]:
a[L]


Out[8]:
array([0, 2])

In [9]:
a[L] = 100
a


Out[9]:
array([100,   1, 100,   3,   4])

In [10]:



Out[10]: