profile_data[id]['name'] = string.join(l[4:])
                    profile_data[id]['time'] = []
                    profile_data[id]['duration'] = []
                    profile_data[id]['model_t'] = []
                profile_data[id]['time'].append(float(l[0]))
                profile_data[id]['duration'].append(float(l[1]))
                profile_data[id]['model_t'].append(float(l[3]))
    return profile_data


data = read_profile('glide.profile')

plot = PyGMT.Canvas('profile.ps',size='A4')
plot.defaults['LABEL_FONT_SIZE']='12p'
plot.defaults['ANOT_FONT_SIZE']='10p'

area = PyGMT.AutoXY(plot,size=[18.,10.],pos=[0.,4.])
keyarea = PyGMT.KeyArea(plot,size=[18.,2.])
keyarea.num=[4,4]
i = 0
for id in data.keys():
    area.line('-W1/%s'%Colours[i],data[id]['time'], data[id]['duration'])
    keyarea.plot_line(data[id]['name'],'1/%s'%Colours[i])
    i = i+1
area.finalise()
area.xlabel='total elapsed time [CPU time]'
area.ylabel='duration of operation [CPU time]'
area.axis='WeSn'
area.coordsystem()
plot.close()
Ejemplo n.º 2
0
                gn = gn+1
    print grids
    key_y=2.5
    ysize = 7.
    dy = 1.

    # create plot
    plot = PyGMT.Canvas('blub.ps',size='A4')
    plot.defaults['LABEL_FONT_SIZE']='12p'
    plot.defaults['ANOT_FONT_SIZE']='10p'

    bigarea = PyGMT.AreaXY(plot,size=[30,30])

    bigarea.text([7.5,2*ysize+3*dy+key_y],"Experiment %s"%exp,textargs='20 0 0 CM')

    area_dome = PyGMT.AutoXY(bigarea,pos=[0.,key_y+dy],size=[15,ysize],logx=True)
    area_dome.xlabel = 'time step [a]'
    area_dome.ylabel = 'dome error [m]'
    area_dome.axis = 'WeSn'

    area_max = PyGMT.AutoXY(bigarea,pos=[0.,ysize+2*dy+key_y],size=[15,ysize],logx=True)
    area_max.xlabel = 'time step [a]'
    area_max.ylabel = 'max error [m]'
    area_max.axis = 'Wesn'

    s_keyarea = PyGMT.KeyArea(bigarea,pos=[0.,-0.8],size=[5,key_y])
    s_keyarea.num=[1,7]

    e_keyarea = PyGMT.KeyArea(bigarea,pos=[5.,-0.8],size=[10.,key_y])
    e_keyarea.num=[2,7]