Пример #1
0
def LSAplot(acc = [0, 6], age = [13, 20] ):
    '''This function is not correct.
    '''
    
    lsa_data = ea.loadLSA_data()

    fig = plt.figure()
    fig.set_tight_layout(True)
    ax = fig.add_subplot(111)
    pf.AxisFormat(20)
    pf.TufteAxis(ax, ['left', 'bottom'], [5,5], integer='on')
    
    for j in range(0,len(age)):
        for i in range(0,len(acc)):

            ea.findPlottingData(acc[j],'lens_accommodation_D', age[i], 'age_y')
            
            x1dat = data['defocus'][loc]
            y1dat = data['pupil_size_mm'][loc]
            
            ax.plot(x1dat, y1dat, linewidth=2.5,
                    label='{0} D, {1} y'.format(acc[i], age[j]));
            
    ax.legend(loc = 'lower right').set_title('Accommodation')

    plt.ylabel('pupil size')
    plt.xlabel('diopters')
    plt.show()
Пример #2
0
def PowerPlots(acc = [0,2,4,6,8], age = [10, 20]):
    '''
    '''
    lsa_data = ea.loadLSA_data()

    fig = plt.figure()
    fig.set_tight_layout(True)
    ax = fig.add_subplot(111)
    pf.AxisFormat(20)
    pf.TufteAxis(ax, ['left', 'bottom'], [5,5], integer='on')

    linestyle = ['ko-','ko--','ko-.','koD']
    for j in range(0, len(age)):
        x1dat, y1dat, topaxis = [],[],[]
        for i in range(0, len(acc)):
            
            ea.findPlottingData(acc[i],'lens_accommodation_D', 
                age[j], 'age', 5, 'pupil_size_mm')
            x1dat = np.append(x1dat, 
                data['lens_accommodation_D'][loc])
            y1dat = np.append(y1dat, 
                data['accomPower'][loc])
            topaxis = np.append(topaxis, 
                data['defocus'][loc])
        
        
        ax.plot(x1dat, y1dat, linestyle[j],
            linewidth=2.5, ms=10, 
            label = '{0} years'.format(age[j]))

    ax.legend(loc = 'upper left')
    
    plt.xlim([min(acc)-0.1, max(acc)+0.1])
    plt.ylabel('power (D)')
    plt.xlabel('accommodation (D)')
    plt.show()