       }()
       for network in networks {
         // Read the results from all saved result files.
-        let resultsDir = self.resultsDir
+        let resultsDir = resultsDir
           .appendingPathComponent(observation.description)
           .appendingPathComponent(network.description)
         guard let resultFiles = try? FileManager.default.contentsOfDirectory(

    // Use exponential notation for the x-axis labels.
    let xAxisFormatter = mpl.ticker.ScalarFormatter()
    xAxisFormatter.set_powerlimits([-3, 3])
    ax.xaxis.set_major_formatter(xAxisFormatter)

    // Add axis labels.
    ax.set_xlabel(
      "Time Step",
      color: "grey",
      fontname: "Lato",
      fontsize: 18,
      fontweight: "light")
    ax.set_ylabel(
      "Reward Rate (pts/s)",
      color: "grey",
      fontname: "Lato",
      fontsize: 18,
      fontweight: "light")
    ax.yaxis.set_tick_params(labelbottom: true)

    // Change the tick label sizes.
    plt.setp(ax.get_xticklabels(), fontname: "Lato", fontsize: 18, fontweight: "regular")
    plt.setp(ax.get_yticklabels(), fontname: "Lato", fontsize: 18, fontweight: "regular")

    // Set the figure title.
    figure.suptitle(

        // Plot a line for this observation-network combination.
        let colorPalette = network == .plain ? bluePalette : redPalette
        lines.plotWithStandardError(
          on: axes,
          label: "\(network.description)-\(observation.description)",
          color: colorPalette[observationIndex])

        if !rewardSchedules.isEmpty {
          assert(rewardSchedules.allSatisfy { $0 == rewardSchedules.first! })
          rewardSchedules.first!.addVerticalAnnotations(on: axes)
        }
      }
    }
