code: def calculate_and_plot_end_to_end_distance(neurite):
      '''Calculate and plot the end-to-end distance vs the number of segments for
      an increasingly larger part of a given neurite.
  
      Note that the plots are not very meaningful for bifurcating trees.'''
      def _dist(seg):
          '''Distance between segmenr end and trunk'''
          return morphmath.point_dist(seg[1], neurite.root_node.points[0])
  
      end_to_end_distance = [_dist(s) for s in nm.iter_segments(neurite)]
      make_end_to_end_distance_plot(np.arange(len(end_to_end_distance)) + 1,
                                    end_to_end_distance, neurite.typef calculate_and_plot_end_to_end_distance(neurite):
      '''Calculate and plot the end-to-end distance vs the number of segments for
      an increasingly larger part of a given neurite.
  
      Note that the plots are not very meaningful for bifurcating trees.'''
      def _dist(seg):
          '''Distance between segmenr end and trunk'''
          return morphmath.point_dist(seg[1], neurite.root_node.points[0])
  
      end_to_end_distance = [_dist(s) for s in nm.iter_segments(neurite)]
      make_end_to_end_distance_plot(np.arange(len(end_to_end_distance)) + 1,
                                    end_to_end_distance, neurite.type)
docs: Calculate and plot the end-to-end distance vs the number of segments for
      an increasingly larger part of a given neurite.
  
      Note that the plots are not very meaningful for bifurcating trees.