# Path: e3fp_paper/plotting/defaults.py
# class DefaultFonts(object):
# 
#     """Default fonts/sizes for plotting."""
# 
#     def __init__(self):
#         self.panel_label_fontsize = 12
#         self.title_fontsize = 8
#         self.ax_label_fontsize = 8
#         self.ax_ticks_fontsize = 7
#         self.legend_fontsize = 7
# 
# Path: e3fp_paper/plotting/util.py
# def add_panel_labels(fig=None, axes=None, xoffset=.17, yoffset=.03,
#                      label_offset=0):
#     """Add labels to all axes."""
#     panel_labels = string.ascii_uppercase[label_offset:]
# 
#     if axes is None or len(axes) == 0:
#         axes = fig.get_axes()
# 
#     try:
#         x = [-v for v in xoffset]
#     except TypeError:
#         x = [-xoffset for v in axes]
# 
#     try:
#         y = [1 + v for v in yoffset]
#     except TypeError:
#         y = [1 + yoffset for v in axes]
# 
#     for i, ax in enumerate(axes):
#         label = panel_labels[i]
#         ax.text(x[i], y[i], s=label, fontsize=fonts.panel_label_fontsize,
#                 fontweight='bold', va='bottom', ha='right',
#                 transform=ax.transAxes)


import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
from e3fp_paper.plotting.defaults import DefaultFonts
from e3fp_paper.plotting.util import add_panel_labels
    df = pd.concat(final_dfs, axis=0)
    df = df.loc[df["Mol Num"] == 100000]
    min_tc_cutoff = df["Fold TC Cutoff"].min()
    max_tc_cutoff = df["Fold TC Cutoff"].max()
    fig = plt.figure(figsize=(7, 2.4))
    ax = fig.add_subplot(131)
    plot_auc_scatter(df, ax, alpha=.8, vmin=min_tc_cutoff,
                     vmax=max_tc_cutoff)
    ax.set_ylim(0.4, .99)
    ax.set_xlim(0.4, .99)
    ax.set_aspect(1)
    sns.despine(ax=ax, offset=10)

    ax = fig.add_subplot(132)
    tmp_df = df[((df["Fold AUROC"] < .95) &
                 (df["Fold AUPRC"] > .5))]
    plot_auc_scatter(tmp_df, ax, alpha=1,
                     ref_auc_pair=(MAX_ECFP4_AUROC, MAX_ECFP4_AUPRC),
                     vmin=min_tc_cutoff, vmax=max_tc_cutoff)
    ax.set_aspect(1. / ax.get_data_ratio())
    sns.despine(ax=ax, offset=10)

    ax = fig.add_subplot(133)
    tmp_df = df[df["Fold AUROC"] > .95]
    plot_auc_scatter(tmp_df, ax, alpha=1,
                     ref_auc_pair=(MAX_ECFP4_AUROC, MAX_ECFP4_AUPRC),
                     vmin=min_tc_cutoff, vmax=max_tc_cutoff)
    ax.set_aspect(1. / ax.get_data_ratio())
    sns.despine(ax=ax, offset=10)


# Path: e3fp_paper/plotting/defaults.py
# class DefaultFonts(object):
# 
#     """Default fonts/sizes for plotting."""
# 
#     def __init__(self):
#         self.panel_label_fontsize = 12
#         self.title_fontsize = 8
#         self.ax_label_fontsize = 8
#         self.ax_ticks_fontsize = 7
#         self.legend_fontsize = 7
# 
# Path: e3fp_paper/plotting/util.py
# def add_panel_labels(fig=None, axes=None, xoffset=.17, yoffset=.03,
#                      label_offset=0):
#     """Add labels to all axes."""
#     panel_labels = string.ascii_uppercase[label_offset:]
# 
#     if axes is None or len(axes) == 0:
#         axes = fig.get_axes()
# 
#     try:
#         x = [-v for v in xoffset]
#     except TypeError:
#         x = [-xoffset for v in axes]
# 
#     try:
#         y = [1 + v for v in yoffset]
#     except TypeError:
#         y = [1 + yoffset for v in axes]
# 
#     for i, ax in enumerate(axes):
#         label = panel_labels[i]
#         ax.text(x[i], y[i], s=label, fontsize=fonts.panel_label_fontsize,
#                 fontweight='bold', va='bottom', ha='right',
#                 transform=ax.transAxes)


# Path: project/analysis/optimization/plot_cv_performance.py
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
from e3fp_paper.plotting.defaults import DefaultFonts
from e3fp_paper.plotting.util import add_panel_labels

    df = pd.concat(final_dfs, axis=0)
    df = df.loc[df["Mol Num"] == 100000]
    min_tc_cutoff = df["Fold TC Cutoff"].min()
    max_tc_cutoff = df["Fold TC Cutoff"].max()
    fig = plt.figure(figsize=(7, 2.4))
    ax = fig.add_subplot(131)
    plot_auc_scatter(df, ax, alpha=.8, vmin=min_tc_cutoff,
                     vmax=max_tc_cutoff)
    ax.set_ylim(0.4, .99)
    ax.set_xlim(0.4, .99)
    ax.set_aspect(1)
    sns.despine(ax=ax, offset=10)

    ax = fig.add_subplot(132)
    tmp_df = df[((df["Fold AUROC"] < .95) &
                 (df["Fold AUPRC"] > .5))]
    plot_auc_scatter(tmp_df, ax, alpha=1,
                     ref_auc_pair=(MAX_ECFP4_AUROC, MAX_ECFP4_AUPRC),
                     vmin=min_tc_cutoff, vmax=max_tc_cutoff)
    ax.set_aspect(1. / ax.get_data_ratio())
    sns.despine(ax=ax, offset=10)

    ax = fig.add_subplot(133)
    tmp_df = df[df["Fold AUROC"] > .95]
    plot_auc_scatter(tmp_df, ax, alpha=1,
                     ref_auc_pair=(MAX_ECFP4_AUROC, MAX_ECFP4_AUPRC),
                     vmin=min_tc_cutoff, vmax=max_tc_cutoff)
    ax.set_aspect(1. / ax.get_data_ratio())
    sns.despine(ax=ax, offset=10)


    add_panel_labels(fig, xoffset=.32)