function f = draw_roads(line_specs, P)

for i=1:length(P.roads)

  road = P.roads(i);

  for j=1:length(road.lanes)
    lane = road.lanes(j);
    
    p_left_start = road.frame*[0; lane.ey + lane.width/2; 1];
    p_left_end = road.frame*[road.s_end; lane.ey + lane.width/2; 1];

    p_right_start = road.frame*[0; lane.ey - lane.width/2; 1];    
    p_right_end = road.frame*[road.s_end; lane.ey - lane.width/2; 1];
    
    plot([p_left_start(1), p_left_end(1)], [p_left_start(2), p_left_end(2)], line_specs);
    hold on
    plot([p_right_start(1), p_right_end(1)], [p_right_start(2), p_right_end(2)], line_specs);

  end
  
  marker = '+';
  
  switch road.intersection.sign
   case P.kStop
    marker = 'o';
    
   case P.kYield
    marker = 'v';
    
   case P.kNone
    marker = '.';
    
   otherwise
    disp('unsupported sign')
  end  
  
  lane_right = road.lanes(1);
  lane_left = road.lanes(end);
  
  ey_right = lane_right.ey + sign(lane_right.ey)*(lane_right.width/2);
  ey_left = lane_left.ey + sign(lane_left.ey)*(lane_left.width/2);

  if isfield(road, 'intersection')
    intersection_box = road.frame*[road.intersection.s0, road.intersection.s0, road.intersection.sf, road.intersection.sf, road.intersection.s0;
                        ey_left, ey_right, ey_right, ey_left, ey_left;
                        1, 1, 1, 1, 1];
    
    stop_region_s0 =  road.intersection.s0 - P.stop_region_length;
    stop_region_sf =  road.intersection.s0 - .2;
    stop_region_box = road.frame*[stop_region_s0, stop_region_s0, stop_region_sf, stop_region_sf, stop_region_s0;
                        ey_left, ey_right, ey_right, ey_left, ey_left;
                        1, 1, 1, 1, 1];
    
    
    p_sign = road.frame*[road.intersection.s0 - 1.5; 
                        min(ey_right, ey_left) - 1.5;
                        1];
    
    plot(p_sign(1), p_sign(2), [marker 'r'], 'MarkerSize', 10);
    
    plot(intersection_box(1,:), intersection_box(2,:), '-g', 'LineWidth', 2);
    plot(stop_region_box(1,:), stop_region_box(2,:), '-r', 'LineWidth', 2);
  end
    
  if isfield(road, 'left_connections')
    % draw an arrow pointing into the next connecting road
    for j=1:length(road.left_connections)
      state = road.left_connections(j).state;
      frame = vehicle_frame(state, P);
      quiver(frame(1,3), frame(2,3), -frame(1,1), -frame(2,1));
    end
  end
  
  if isfield(road, 'right_connections')
    for j=1:length(road.right_connections)
      state = road.right_connections(j).state;
      frame = vehicle_frame(state, P);
      quiver(frame(1,3), frame(2,3), -frame(1,1), -frame(2,1));
    end
  end
  
  if isfield(road, 'obstacles')
    for j=1:length(road.obstacles)
      draw_obstacle(road.obstacles(i), '-r', P);
    end
  end
end
