def draw_cd_diagram(df_perf=None, df_org=None, alpha=0.05, title=None, labels=False, save=False, filename=None, ax=None):
    """
    Draws the critical difference diagram given the list of pairwise classifiers that are
    significant or not
    """

    p_values, average_ranks, _ = wilcoxon_holm(df_perf=df_perf, alpha=alpha)
    average_metrics = list(df_org.apply(np.mean, axis=0)[average_ranks.keys()])

    print(average_ranks)

    for p in p_values:
        print(p)

    print(average_ranks.values, average_ranks.keys())

    line_idx = graph_ranks(average_ranks.values, average_ranks.keys(), p_values,
               cd=None, reverse=True, width=9, textspace=1.5, labels=labels, avmetrics=average_metrics, ax=ax)

    font = {'family': 'sans-serif',
        'color':  'black',
        'weight': 'normal',
        'size': 22,
        }

    if title:
        plt.title(title,fontdict=font, y=1.0, x=0.5)

    if save:
        plt.savefig(filename, bbox_inches='tight', dpi=300)

    # plt.show()

    return line_idx

    Draws the critical difference diagram given the list of pairwise classifiers that are
    significant or not
    
adbench/other_utils/utils.py