cluster_ids = list(cluster_ids)
    cluster_ids.sort()

    for cluster_id in cluster_ids:
        print("{},{}".format(
            cluster_id,
            o_data.df.loc[o_data.df['cluster_id'] == cluster_id].shape[0]))

    from matplotlib import cm
    n_clusters = len(cluster_ids)
    o_ref_data = PyposmatDataFile()
    o_ref_data.read(filename=ref_data_fn)
    n_reference_potentials = o_ref_data.df.shape[0]
    cm_subsection = np.linspace(0.0, 1.0, n_clusters + n_reference_potentials)
    colors = [cm.jet(i) for i in cm_subsection]
    o_plot = PyposmatParallelCoordinatesPlot()
    for i, cluster_id in enumerate(cluster_ids):
        df = o_data.df.loc[o_data.df['cluster_id'] == cluster_id]
        o_plot.plot(config=o_config,
                    data=o_data,
                    label=cluster_id,
                    nsmallest=20,
                    linewidth=1,
                    alpha=0.7,
                    color=colors[i],
                    cluster_id=cluster_id)

    # plot the reference potentials for comparison
    o_plot.plot_reference_potentials(config=ref_config_fn,
                                     data=ref_data_fn,
                                     linewidth=5)
    if qoi_type == 'by_qoi_target':
        o_data.create_normalized_errors(normalize_type='by_qoi_target',
                                        qoi_targets=o_config.qoi_targets)
        df = o_data.df[o_data.normalized_error_names]


if __name__ == "__main__":
    # reset the plot directory
    plot_dir = 'parallel_plots'
    if os.path.isdir(plot_dir):
        shutil.rmtree(plot_dir)
    os.mkdir(plot_dir)

    figure_fn = os.path.join(plot_dir, 'parallel_plot.jpg')

    o_plot = PyposmatParallelCoordinatesPlot()
    o_plot.create_subplots()
    for k, v in parallel_plot_config.items():
        print(v)
        o_plot.plot(config=v['config_fn'],
                    data=v['data_fn'],
                    label=v['label'],
                    color=v['color'],
                    nsmallest=20,
                    alpha=0.7)

    ref_config_fn = os.path.join(
        pypospack.utils.get_pypospack_root_directory(), 'data', 'Si__sw__data',
        'reference_potentials', 'pyposmat.config.in')
    ref_data_fn = os.path.join(pypospack.utils.get_pypospack_root_directory(),
                               'data', 'Si__sw__data', 'reference_potentials',