def sort_branch_list(branch_labels, ref_branch_label='control'):
    """Order branch labels for plotting, consistently.

    The control branch goes last because some plots include a series
    for it, and some plots don't, and we want the colors to be
    consistent between these plots.
    """
    assert ref_branch_label in branch_labels
    return sorted(set(branch_labels) - {ref_branch_label}) + [ref_branch_label]
