Exemplo n.º 1
0
    def plot_all(scan_res_double, plot_selections, tt, axes_double):
        for scan_res, axes in zip(scan_res_double, axes_double):

            scan_res = np.array(scan_res, dtype=object)
            param_vals, results, transition_states = scan_res.T
            cmap = mpl.cm.coolwarm
            for sel, ax in zip(plot_selections, axes):
                ax.set_ylabel(unit_dict[sel])

                for i, res in enumerate(results):
                    color = aux.get_color(cmap, i, len(results))
                    t = res["time"] / 60
                    ax.plot(t[t <= tt], res[sel][t <= tt], color=color)
                # if sel in ["SN_Sbf_ac", "V_tot_fl"]:
                for i, ts in enumerate(transition_states):
                    ax.plot(ts["time"] / 60, ts[sel], mfc=aux.get_color(cmap, i, len(results)), marker="o", mec="black",
                            zorder=5)

            if "SN_Sbf_ac" in plot_selections:
                idx = plot_selections.index("SN_Sbf_ac")
                axes[idx].plot([min(t), tt], [0.5, 0.5], color="grey", linestyle="--")
                handles = [
                    Line2D([0], [0], linestyle="none", marker="o", markerfacecolor="none", markeredgecolor="black",
                           label="transition point")]
                axes[-1].legend(handles=handles, frameon=False, loc="lower right")
def plot_vdiv_tg1_multi(scan_results, ax):
    cmap = mpl.cm.coolwarm
    ax.set_xlabel("volume after division [fL]")
    ax.set_ylabel("duration of G1 [min]")
    ax.tick_params()
    for i, scan_res in enumerate(scan_results):
        color = aux.get_color(cmap, i, len(scan_results))
        _plot_vdiv_tg1(scan_res, ax, color)
def plot_vdiv_vstart_multi(scan_results, ax, plot_selections):
    cmap = mpl.cm.coolwarm
    ax.set_xlabel("volume after division [fL]")
    ax.set_ylabel("volume at START [fl]")
    ax.tick_params()
    for i, scan_res in enumerate(scan_results):
        color = aux.get_color(cmap, i, len(scan_results))
        _plot_vdiv_vg1(scan_res, ax, plot_selections, color)

    ax.plot([10, 60], [10, 60], color="grey", linestyle="--", label="identity")
def plot_vdiv_y_multi(results: pd.DataFrame, df_column: str, ax):
    cmap = mpl.cm.coolwarm
    ax.set_xlabel("volume after division [fL]")
    ax.set_ylabel("duration of G1 [min]" if df_column ==
                  "t_g1" else "volume at START [fL]")
    ax.tick_params()
    for i, data in enumerate(results.iterrows()):
        _, row = data
        color = aux.get_color(cmap, i, results.shape[0])
        if df_column == "v_trans":
            ax.plot(row.volume_scans.v_ini,
                    row.volume_scans.v_trans,
                    color=color)
        elif df_column == "t_g1":
            ax.plot(row.volume_scans.v_ini,
                    row.volume_scans.t_g1 / 60,
                    color=color)
        else:
            raise ValueError(
                "Not the right df_column. Choose between \"v_trans\" and \"t_g1\"."
            )