docs: def run_analyze_dimension_and_radius(data, rmin, rmax, nradii, adjacency_method='brute', adjacency_kwds = {},
                                       fit_range=None, savefig=False, plot_name = 'dimension_plot.png'):
      """
      This function is used to estimate the doubling dimension (approximately equal to the intrinsic
      dimension) by computing a graph of neighborhood radius versus average number of neighbors.
  
      The "radius" refers to the truncation constant where all distances greater than
      a specified radius are taken to be infinite. This is used for example in the
      truncated Gaussian kernel in estimate_radius.py
  
  
      Parameters
      ----------
      data : numpy array,
          Original data set for which we are estimating the bandwidth
      rmin : float,
          smallest radius to consider
      rmax : float,
          largest radius to consider
      nradii : int,
          number of radii between rmax and rmin to consider
      adjacency_method : string,
          megaman adjacency method to use, default 'brute' see geometry.py for details
      adjacency_kwds : dict,
          dictionary of keywords for adjacency method
      fit_range : list of ints,
          range of radii to consider default is range(nradii), i.e. all of them
      savefig: bool,
          whether to save the radius vs. neighbors figure
      plot_name: string,
          filename of the figure to be saved as.
  
      Returns
      -------
      results : dictionary
          contains the radii, average nieghbors, min and max number of neighbors and number
          of points with no neighbors.
      dim : float,
          estimated doubling dimension (used as an estimate of the intrinsic dimension)
      """
      n, D = data.shape
      radii = 10**(np.linspace(np.log10(rmin), np.log10(rmax), nradii))
      dists = compute_largest_radius_distance(data, rmax, adjacency_method, adjacency_kwds)
      results = neighborhood_analysis(dists, radii)
      avg_neighbors = results['avg_neighbors'].flatten()
      radii = results['radii'].flatten()
      if fit_range is None:
          fit_range = range(len(radii))
      dim = find_dimension_plot(avg_neighbors, radii, fit_range, savefig, plot_name)
      return(results, dim)