def ci_to_errsize(cis, heights):
 cis = np.atleast_2d(cis).reshape(2, (-1))
 heights = np.atleast_1d(heights)
 errsize = []
 for (i, (low, high)) in enumerate(np.transpose(cis)):
  h = heights[i]
  elow = (h - low)
  ehigh = (high - h)
  errsize.append([elow, ehigh])
 errsize = np.asarray(errsize).T
 return errsize

def ci_to_errsize ( cis , heights ) : cis = np . atleast_2d ( cis ) . reshape ( 2 , ( - 1 ) ) heights = np . atleast_1d ( heights ) errsize = [ ] for ( i , ( low , high ) ) in enumerate ( np . transpose ( cis ) ) : h = heights [ i ] elow = ( h - low ) ehigh = ( high - h ) errsize . append ( [ elow , ehigh ] ) errsize = np . asarray ( errsize ) . T return errsize
convert intervals to error arguments relative to plot heights .