def showVaryMultiplePCS( asm, vals, vecs, numPlots, numPCs, newpal):
    f, axes = plt.subplots( 1, numPlots, sharex = True, sharey = True )
    bs = []
    for p in range( numPCs ):
        rs = np.linspace( - MUL * math.sqrt( vals[p] ), MUL * math.sqrt( vals[p] ), numPlots )
        bs.append( rs )
    P = vecs[:, 0:numPCs]
    for pl in range(numPlots) :
        b = [ bs[p][pl] for p in range(len(bs) ) ]
        X = np.add( asm.meanShape.allPts, np.dot( P, b ) )
        x, y = reravel( X )
        s = Shape( [ Point (pt[0], pt[1] ) for pt in zip(x,y) ])
        s.draw( newpal, axes[pl] ) ## diff
        axes[pl].plot( s.xs, s.ys, lw =1, c ='k')
    f.savefig( "simple-example-%d-at-a-time.png" % numPCs)
def showVary( asm, vals, vecs, numPlots, eval ):
    # Vary one eigenvalue
    f, axes = plt.subplots( 1, numPlots, sharex = True, sharey = True )

    vals = np.ravel( vals )
    rs = np.linspace( - MUL * math.sqrt( vals[eval] ), MUL * math.sqrt( vals[eval] ), numPlots )
    
    for m in range( len(rs) ):
        reps = np.add(asm.meanShape.allPts,np.multiply( np.ravel(vecs[:,eval] ), rs[m] ))
        x, y = reravel( reps )
        s = Shape( [ Point (pt[0], pt[1] ) for pt in zip(x,y) ])
        s.draw( newpal, axes[m] ) ## diff
        axes[m].plot( s.xs, s.ys, lw =1, c ='k')

    plt.savefig( 'simple-example-PC%d.png'% eval )