code: def __equalize_densities(self,nominal_bounds,nominal_density):
          
          left,bottom,right,top = nominal_bounds.lbrt()
          width = right-left; height = top-bottom
          center_y = bottom + height/2.0
          # True density is not equal to the nominal_density when
          # nominal_density*(right-left) is not an integer.
          true_density = int(nominal_density*(width))/float(width)
  
          n_cells = round(height*true_density,0)
          adjusted_half_height = n_cells/true_density/2.0
  
          return (BoundingBox(points=((left, center_y-adjusted_half_height),
                                      (right, center_y+adjusted_half_height))),
                  true_density)
docs: Calculate the true density along x, and adjust the top and
          bottom bounds so that the density along y will be equal.
  
          Returns (adjusted_bounds, true_density)