     // Use exponential notation for the x-axis labels.
     let xAxisFormatter = mpl.ticker.ScalarFormatter()
     xAxisFormatter.set_powerlimits([-3, 3])
-    ax.xaxis.set_major_formatter(xAxisFormatter)
+    axes.xaxis.set_major_formatter(xAxisFormatter)
 
     // Add axis labels.
-    ax.set_xlabel(
+    axes.set_xlabel(
       "Time Step",
       color: "grey",
       fontname: "Lato",
       fontsize: 18,
       fontweight: "light")
-    ax.set_ylabel(
+    axes.set_ylabel(
       "Reward Rate (pts/s)",
       color: "grey",
       fontname: "Lato",
       fontsize: 18,
       fontweight: "light")
-    ax.yaxis.set_tick_params(labelbottom: true)
+    axes.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")
+    plt.setp(axes.get_xticklabels(), fontname: "Lato", fontsize: 18, fontweight: "regular")
+    plt.setp(axes.get_yticklabels(), fontname: "Lato", fontsize: 18, fontweight: "regular")
 
     // Set the figure title.
     figure.suptitle(


    // Create a new figure.
    let figure = plt.figure(figsize: [10.0, 6.0])
    let ax = plt.gca()

    // Plot the curves for all observation-network combinations.
    for observation in observations {

        // 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)
        }
      }
    }
