code: def _non_linear_scaling(
      performance_profiles,
      tau_list,
      xticklabels=None,
      num_points=5,
      log_base=2,
  ):
      """Returns non linearly scaled tau as well as corresponding xticks.
  
      The non-linear scaling of a certain range of threshold values is proportional
      to fraction of runs that lie within that range.
  
      Args:
        performance_profiles: A dictionary mapping a method to its performance
          profile, where each profile is computed using thresholds in `tau_list`.
        tau_list: List or 1D numpy array of threshold values on which the profile is
          evaluated.
        xticklabels: x-axis labels correspond to non-linearly scaled thresholds.
        num_points: If `xticklabels` are not passed, then specifices the number of
          indices to be generated on a log scale.
        log_base: Base of the logarithm scale for non-linear scaling.
  
      Returns:
        nonlinear_tau: Non-linearly scaled threshold values.
        new_xticks: x-axis ticks from `nonlinear_tau` that would be plotted.
        xticklabels: x-axis labels correspond to non-linearly scaled thresholds.
      """
  
      methods = list(performance_profiles.keys())
      nonlinear_tau = np.zeros_like(performance_profiles[methods[0]])
      for method in methods:
          nonlinear_tau += performance_profiles[method]
      nonlinear_tau /= len(methods)
      nonlinear_tau = 1 - nonlinear_tau
  
      if xticklabels is None:
          tau_indices = np.int32(
              np.logspace(
                  start=0,
                  stop=np.log2(len(tau_list) - 1),
                  base=log_base,
                  num=num_points,
              )
          )
          xticklabels = [tau_list[i] for i in tau_indices]
      else:
          tau_as_list = list(tau_list)
          # Find indices of x which are in `tau`
          tau_indices = [tau_as_list.index(x) for x in xticklabels]
      new_xticks = nonlinear_tau[tau_indices]
      return nonlinear_tau, new_xticks, xticklabels
  
file_path: rliable/rliable/plot_utils.py
imports: import matplotlib.pyplot
  import numpy
  import seaborn
label_desc: Use image node_id 1 for calling a global function with example usage: _non_linear_scaling(performance_profiles, tau_list, xticklabels, num_points, log_base) and returns: nonlinear_tau,  new_xticks,  xticklabels