Ejemplo n.º 1
0
def plot_intrinsic(X, w, h):    
    svg =  MYSVGWriter(640, 480, -100, -100, 100, 100)    
    x_prev, y_prev = None, None
    for row in X:                
        x= 10**1*row[0] #to scale data
        y= 10**1*row[1] #to scale data        
        svg.dot(x ,y,1, 0x008080)
        if x_prev and y_prev:
            svg.line(x_prev, y_prev, x, y, .05, 0xc0c0c0)        
        x_prev=x
        y_prev=y        
    svg.svgprint("intrinsic.svg")    
Ejemplo n.º 2
0
    svg =  MYSVGWriter(500, 500, 0, 0, 100, 100)
    start_position=4
    for i in range(len( pca02.eigenvalues)):        
        svg.rect(start_position, 0, 3, 27*pca02.eigenvalues[i] , 0x008080)
        start_position+= 4                

#    print pca02.eigenvalues
    svg.svgprint("plot3.svg")
    
    #plot4.svg
    svg =  MYSVGWriter(500, 500, -100, -100, 110, 110)
    start_position=10
    for i  in range(len( pca02.matrix)):        
        row = pca02.matrix[i]
        reduced= pca02.reduce(row[:len(row)], 2)
        x= 10**17*reduced[0]#to scale data
        y= 10**17*reduced[1]#to scale data
        
        if pca02.Y[i][0]:
            svg.dot(x ,y,1, 0x008080)
        else:
            svg.dot(x ,y,1, 0x800000)
    
    svg.svgprint("plot4.svg")    
        
        
    print 'done'