code: def plotConvergenceByColumn(results, columnRange, featureRange, numTrials, lineStype='-'):
    
    ########################################################################
    #
    # Accumulate all the results per column in a convergence array.
    #
    # Convergence[f,c] = how long it took it to  converge with f unique features
    # and c columns.
    convergence = numpy.zeros((max(featureRange), max(columnRange) + 1))
    for r in results:
      if r["numColumns"] > max(columnRange):
        continue
      convergence[r["numFeatures"] - 1,
                  r["numColumns"]] += r["convergencePoint"]
    convergence /= numTrials
    # For each column, print convergence as fct of number of unique features
    # for c in range(1, max(columnRange) + 1):
    #   print c, convergence[:, c]
    # Print everything anyway for debugging
    # print "Average convergence array=", convergence
    ########################################################################
    #
    # Create the plot. x-axis=
    # Plot each curve
    legendList = []
    colorList = ['r', 'b', 'g', 'm', 'c', 'k', 'y']
    for i in range(len(featureRange)):
      f = featureRange[i]
      print f, columnRange
      print convergence[f-1,columnRange]
      legendList.append('Unique features={}'.format(f))
      plt.plot(columnRange, convergence[f-1,columnRange],
               color=colorList[i], linestyle=lineStype)
    print
    # format
    plt.legend(legendList, loc="upper right")
    plt.xlabel("Number of columns")
    plt.xticks(columnRange)
    plt.ylim([0, 4])
    plt.yticks(range(0,int(convergence.max())+1))
    plt.ylabel("Average number of sensations")
    plt.title("Number of sensations to recognize one object (multiple columns)")
docs: Plots the convergence graph: iterations vs number of columns.
    Each curve shows the convergence for a given number of unique features.