code: def plotOneInferenceRun(stats,
                          fields,
                          basename,
                          itemType="",
                          plotDir="plots",
                          ymax=100,
                          trialNumber=0):
    
    if not os.path.exists(plotDir):
      os.makedirs(plotDir)
  
    plt.figure()
  
    # plot request stats
    for field in fields:
      fieldKey = field[0] + " C0"
      plt.plot(stats[fieldKey], marker='+', label=field[1])
  
    # format
    plt.legend(loc="upper right")
    plt.xlabel("Input number")
    plt.xticks(range(stats["numSteps"]))
    plt.ylabel("Number of cells")
    plt.ylim(-5, ymax)
    plt.title("Activity while inferring {}".format(itemType))
  
    # save
    relPath = "{}_exp_{}.pdf".format(basename, trialNumber)
    path = os.path.join(plotDir, relPath)
    plt.savefig(path)
    plt.close()
docs: Plots individual inference runs.