parameters: (th1s, ylog, xmin=None, xmax=None, ymin=None, ymax=None)
return_statement: return (xmin, ymin, xmax, ymax)
docstring: Find x-y axis boundaries encompassing a list of TH1s if the bounds are not given in arguments.
  
      Arguments:
      th1s -- List of TH1s
      ylog -- Boolean indicating if y axis is in log scale or not (affects the automatic ymax)
  
      Keyword arguments:
      xmin -- Minimum x value; if None, take the minimum of TH1s
      xmax -- Maximum x value; if None, take the maximum of TH1s
      ymin -- Minimum y value; if None, take the minimum of TH1s
      ymax -- Maximum y value; if None, take the maximum of TH1s
docstring_summary: Find x-y axis boundaries encompassing a list of TH1s if the bounds are not given in arguments.
docstring_tokens: Find x - y axis boundaries encompassing a list of TH1s if the bounds are not given in arguments .
function: def _findBounds(th1s, ylog, xmin=None, xmax=None, ymin=None, ymax=None):
      """Find x-y axis boundaries encompassing a list of TH1s if the bounds are not given in arguments.
  
      Arguments:
      th1s -- List of TH1s
      ylog -- Boolean indicating if y axis is in log scale or not (affects the automatic ymax)
  
      Keyword arguments:
      xmin -- Minimum x value; if None, take the minimum of TH1s
      xmax -- Maximum x value; if None, take the maximum of TH1s
      ymin -- Minimum y value; if None, take the minimum of TH1s
      ymax -- Maximum y value; if None, take the maximum of TH1s
      """
  
      (ymin, ymax) = _findBoundsY(th1s, ylog, ymin, ymax)
  
      if xmin is None or xmax is None or isinstance(xmin, list) or isinstance(max, list):
          xmins = []
          xmaxs = []
          for th1 in th1s:
              xmins.append(_getXmin(th1, limitToNonZeroContent=isinstance(xmin, list)))
              xmaxs.append(_getXmax(th1, limitToNonZeroContent=isinstance(xmax, list)))
  
          # Filter out cases where histograms have zero content
          xmins = [h for h in xmins if h is not None]
          xmaxs = [h for h in xmaxs if h is not None]
  
          if xmin is None:
              xmin = min(xmins)
          elif isinstance(xmin, list):
              if len(xmins) == 0: # all histograms zero
                  xmin = min(xmin)
                  if verbose:
                      print("Histogram is zero, using the smallest given value for xmin from", str(xmin))
              else:
                  xm = min(xmins)
                  xmins_below = [x for x in xmin if x<=xm]
                  if len(xmins_below) == 0:
                      xmin = min(xmin)
                      if xm < xmin:
                          if verbose:
                              print("Histogram minimum x %f is below all given xmin values %s, using the smallest one" % (xm, str(xmin)))
                  else:
                      xmin = max(xmins_below)
  
          if xmax is None:
              xmax = max(xmaxs)
          elif isinstance(xmax, list):
              if len(xmaxs) == 0: # all histograms zero
                  xmax = max(xmax)
                  if verbose:
                      print("Histogram is zero, using the smallest given value for xmax from", str(xmin))
              else:
                  xm = max(xmaxs)
                  xmaxs_above = [x for x in xmax if x>xm]
                  if len(xmaxs_above) == 0:
                      xmax = max(xmax)
                      if xm > xmax:
                          if verbose:
                              print("Histogram maximum x %f is above all given xmax values %s, using the maximum one" % (xm, str(xmax)))
                  else:
                      xmax = min(xmaxs_above)
  
      for th1 in th1s:
          th1.GetXaxis().SetRangeUser(xmin, xmax)
  
      return (xmin, ymin, xmax, ymax)
function_tokens: def _findBounds ( th1s , ylog , xmin = None , xmax = None , ymin = None , ymax = None ) : ( ymin , ymax ) = _findBoundsY ( th1s , ylog , ymin , ymax ) if xmin is None or xmax is None or isinstance ( xmin , list ) or isinstance ( max , list ) : xmins = [ ] xmaxs = [ ] for th1 in th1s : xmins . append ( _getXmin ( th1 , limitToNonZeroContent = isinstance ( xmin , list ) ) ) xmaxs . append ( _getXmax ( th1 , limitToNonZeroContent = isinstance ( xmax , list ) ) ) # Filter out cases where histograms have zero content xmins = [ h for h in xmins if h is not None ] xmaxs = [ h for h in xmaxs if h is not None ] if xmin is None : xmin = min ( xmins ) elif isinstance ( xmin , list ) : if len ( xmins ) == 0 : # all histograms zero xmin = min ( xmin ) if verbose : print ( "Histogram is zero, using the smallest given value for xmin from" , str ( xmin ) ) else : xm = min ( xmins ) xmins_below = [ x for x in xmin if x <= xm ] if len ( xmins_below ) == 0 : xmin = min ( xmin ) if xm < xmin : if verbose : print ( "Histogram minimum x %f is below all given xmin values %s, using the smallest one" % ( xm , str ( xmin ) ) ) else : xmin = max ( xmins_below ) if xmax is None : xmax = max ( xmaxs ) elif isinstance ( xmax , list ) : if len ( xmaxs ) == 0 : # all histograms zero xmax = max ( xmax ) if verbose : print ( "Histogram is zero, using the smallest given value for xmax from" , str ( xmin ) ) else : xm = max ( xmaxs ) xmaxs_above = [ x for x in xmax if x > xm ] if len ( xmaxs_above ) == 0 : xmax = max ( xmax ) if xm > xmax : if verbose : print ( "Histogram maximum x %f is above all given xmax values %s, using the maximum one" % ( xm , str ( xmax ) ) ) else : xmax = min ( xmaxs_above ) for th1 in th1s : th1 . GetXaxis ( ) . SetRangeUser ( xmin , xmax ) return ( xmin , ymin , xmax , ymax )