+def plot_delta_between_point(branch, benchmark_type, x_data, y_data, labels, latest_values):
+ """
+ Plot the graph of delta between each sequential commit.
+ """
+ local_abs_max = 100
+
+ # Transform y_data to a list of for which the reference is the first
+ # element.
+ local_y_data = []
+ for pos, y in enumerate(y_data):
+ if pos == 0:
+ local_y_data.append(0.0)
+ continue
+ local_y_data.append(y - y_data[pos - 1])
+
+ plt.plot(x_data, local_y_data, "o", label=branch, color=graph_get_color(branch))
+
+ # Get max absolute value to align the y axis with zero in the middle.
+ if local_y_data:
+ local_abs_max = abs(max(local_y_data, key=abs)) * 1.3
+
+ plt.ylim(ymin=local_abs_max * -1, ymax=local_abs_max)
+
+ ax = plt.gca()
+ plt.xticks(x_data, labels, rotation=90, family="monospace")
+ plt.title(graph_get_title(branch, benchmark_type) + " Delta to previous commit", fontweight="bold")
+ plt.ylabel("Seconds")
+ plt.xlabel("Latest commits")
+ plt.legend()
+
+ # Put tick on the right side
+ ax.tick_params(labeltop=False, labelright=True)
+
+ plt.tight_layout()
+ return