original_docstring: 
      Visualizes the source and target of a given factor.
  
      Parameters:
          target_img (): connectivity of the target
          source_img (): connectivity of the source
          testname (str): 'top_view', 'flatmap'
          filename (str): name of output image file
          magnitude (int): size of factor??
          factor (int): factor number
      
docstring: Visualizes the source and target of a given factor.
docstring_tokens: Visualizes the source and target of a given factor .
code: def plot_factor(target_img, source_img, testname, filename, magnitude, factor):
      '''
      Visualizes the source and target of a given factor.
  
      Parameters:
          target_img (): connectivity of the target
          source_img (): connectivity of the source
          testname (str): 'top_view', 'flatmap'
          filename (str): name of output image file
          magnitude (int): size of factor??
          factor (int): factor number
      '''
      print(filename)
      figsize = (4,2)
      fig = plt.figure()
  
      ax1 = fig.add_subplot(121)
      ax2 = fig.add_subplot(122)
  
      fig = plt.figure(figsize=(8, 6)) 
  
      ratios = [1.9, 1]
      title_height = 0.85
      title_testname = "Top-View"
      if(testname == 'flatmap'):
          # Ratios when colorbar not included
          ratios = [2, 1]
          # Ratios when colorbar is included
          # ratios = [1.88, 1]
          title_height = 0.7
          title_testname = "Flatmap"
      
      gs = gridspec.GridSpec(1, 2, width_ratios=ratios) 
  
      ax1 = plt.subplot(gs[0])
      ax2 = plt.subplot(gs[1])
  
      top_down_overlay = plt.imread("../cortical_map_top_down.png")
      im1 = create_plot_im(ax1, target_img, top_down_overlay, testname)
      im2 = create_plot_im(ax2, source_img, top_down_overlay, testname, False)
      xlim = ax2.get_xlim()
      ax2.set_xlim(left=xlim[0]  +  (xlim[1]-xlim[0])/2 - 0.025, right=xlim[1])
  
      plt.figtext(0.52,title_height,title_testname + " Factor " + str(factor) + ", Norm: " + "{:.2f}".format(magnitude), ha='center', va='center', fontsize="20")
      plt.savefig(filename.replace(".","_")+".png", dpi=600, bbox_inches='tight')
      plt.clf()
      plt.close()
code_tokens: def plot_factor ( target_img , source_img , testname , filename , magnitude , factor ) : print ( filename ) figsize = ( 4 , 2 ) fig = plt . figure ( ) ax1 = fig . add_subplot ( 121 ) ax2 = fig . add_subplot ( 122 ) fig = plt . figure ( figsize = ( 8 , 6 ) ) ratios = [ 1.9 , 1 ] title_height = 0.85 title_testname = "Top-View" if ( testname == 'flatmap' ) : ratios = [ 2 , 1 ] title_height = 0.7 title_testname = "Flatmap" gs = gridspec . GridSpec ( 1 , 2 , width_ratios = ratios ) ax1 = plt . subplot ( gs [ 0 ] ) ax2 = plt . subplot ( gs [ 1 ] ) top_down_overlay = plt . imread ( "../cortical_map_top_down.png" ) im1 = create_plot_im ( ax1 , target_img , top_down_overlay , testname ) im2 = create_plot_im ( ax2 , source_img , top_down_overlay , testname , False ) xlim = ax2 . get_xlim ( ) ax2 . set_xlim ( left = xlim [ 0 ] + ( xlim [ 1 ] - xlim [ 0 ] ) / 2 - 0.025 , right = xlim [ 1 ] ) plt . figtext ( 0.52 , title_height , title_testname + " Factor " + str ( factor ) + ", Norm: " + "{:.2f}" . format ( magnitude ) , ha = 'center' , va = 'center' , fontsize = "20" ) plt . savefig ( filename . replace ( "." , "_" ) + ".png" , dpi = 600 , bbox_inches = 'tight' ) plt . clf ( ) plt . close ( )
short_docstring: Visualizes the source and target of a given factor.
short_docstring_tokens: Visualizes the source and target of a given factor .
comment: '''
      Visualizes the source and target of a given factor.
  
      Parameters:
          target_img (): connectivity of the target
          source_img (): connectivity of the source
          testname (str): 'top_view', 'flatmap'
          filename (str): name of output image file
          magnitude (int): size of factor??
          factor (int): factor number
      '''$SEP$# Ratios when colorbar not included$SEP$# Ratios when colorbar is included$SEP$# ratios = [1.88, 1]