X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=projects%2Fmicrob2010%2Ftests%2Foa%2Fgraph.py;fp=projects%2Fmicrob2010%2Ftests%2Foa%2Fgraph.py;h=7ba6948ff85124cc7f40b8cdcb966676f2e0d5ae;hp=d5946f1c52b9d4def328d661c7cac06fe9e7d896;hb=a15451f8535228e9193b5dc042929ca0a7f79d9c;hpb=d1cc3debac68c0012f2c5ca33da9bcf0882f4988 diff --git a/projects/microb2010/tests/oa/graph.py b/projects/microb2010/tests/oa/graph.py index d5946f1..7ba6948 100644 --- a/projects/microb2010/tests/oa/graph.py +++ b/projects/microb2010/tests/oa/graph.py @@ -170,7 +170,7 @@ def build_area(ax): # area x,y = build_poly([(0,0), (3000,0), (3000,2100), (0,2100)]) ax.plot(x, y, 'g-') - + x,y = build_poly([(0,0), (0,500), (500,500), (500,0)]) ax.plot(x, y, 'y-') @@ -179,16 +179,38 @@ def build_area(ax): x,y = build_poly([(740,0), (740,500), (2260,500), (2260,0)]) ax.plot(x, y, 'g--') - + + x,y = build_path([(375,0), (375,2050)]) + ax.plot(x, y, 'r-') + + x,y = build_path([(150,1972), (2850,472)]) + ax.plot(x, y, 'r-') + + x,y = build_path([(0,1722), (3000,1722)]) + ax.plot(x, y, 'r-') + + x,y = build_path([(150,972), (1950,1972)]) + ax.plot(x, y, 'r-') + + acoef = (2850-150)/5. + bcoef = (472-1972)/5. + x,y = build_path([(600,1972), (600+bcoef, 1972-acoef)]) + ax.plot(x, y, 'r-') + # limit #x,y = build_poly([(250,250), (2750,250), (2750,1850), (250,1850)]) #ax.plot(x, y, 'g--') - + + xtick = [i * STEP_CORN_X + OFFSET_CORN_X for i in range(WAYPOINTS_NBX)] + ax.set_xticks(xtick) + ytick = [(i-1) * STEP_CORN_Y/2 + OFFSET_CORN_Y for i in range(WAYPOINTS_NBY*2)] + ax.set_yticks(ytick) + init_corn_table(random.randint(0,8), random.randint(0,3)) waypoints = init_waypoints() mark_all_neigh(5,6) - + wcorn = [] bcorn = [] points = [] @@ -250,7 +272,7 @@ def graph(filename): build_area(ax) - ax.grid() + ax.grid(color = (0.3, 0.3, 0.3)) ax.set_xlim(-100, 3100) ax.set_ylim(-100, 2200) #ax.set_title('spline paths')