Пример #1
0
def fill_below_intersection(x, S, Z):
    """
    fill the region below the intersection of S and Z
    """
    #find the intersection point
    ind = nx.nonzero(nx.absolute(S - Z) == min(nx.absolute(S - Z)))[0]
    # compute a new curve which we will fill below
    Y = nx.zeros(S.shape, typecode=nx.Float)
    Y[:ind] = S[:ind]  # Y is S up to the intersection
    Y[ind:] = Z[ind:]  # and Z beyond it
    p.fill(x, Y, facecolor='blue', alpha=0.5)
def fill_below_intersection(x, S, Z):
    """
    fill the region below the intersection of S and Z
    """
    #find the intersection point
    ind = nx.nonzero( nx.absolute(S-Z)==min(nx.absolute(S-Z)))[0]
    # compute a new curve which we will fill below
    Y = nx.zeros(S.shape, typecode=nx.Float)
    Y[:ind] = S[:ind]  # Y is S up to the intersection
    Y[ind:] = Z[ind:]  # and Z beyond it
    p.fill(x, Y, facecolor='blue', alpha=0.5)
Пример #3
0
 def _make_verts(self, U, V):
     uv = U+V*1j
     uv = nx.ravel(nx.ma.filled(uv, nx.nan))
     a = nx.absolute(uv)
     if self.scale is None:
         sn = max(10, math.sqrt(self.N))
         scale = 1.8 * nx.average(a) * sn # crude auto-scaling
         scale = scale/self.span
         self.scale = scale
     length = a/(self.scale*self.width)
     X, Y = self._h_arrows(length)
     xy = (X+Y*1j) * nx.exp(1j*nx.angle(uv[...,nx.newaxis]))*self.width
     xy = xy[:,:,nx.newaxis]
     XY = nx.concatenate((xy.real, xy.imag), axis=2)
     return XY
Пример #4
0
def f(t):
    s1 = sin(2 * pi * t)
    e1 = exp(-t)
    return absolute(multiply(s1, e1)) + .05
Пример #5
0
def f(t):
    s1 = sin(2*pi*t)
    e1 = exp(-t)
    return absolute(multiply(s1,e1))+.05