def plot_all_scan(scan_res, selections, plot_selections, unit_dict,
                  param_val_fun, param_desc):
    plot_all = get_plot_all_fun(selections, plot_selections, unit_dict)
    lets = [x for x in "efcdab"]
    fig, big_ax = plt.subplots()
    aux.clean_big_ax(big_ax)
    inset_dict = aux.get_inset_loc(nx=2, ny=3, hs=0.1, vs=0.05)
    axes = [big_ax.inset_axes(inset_dict[key]) for key in inset_dict]
    big_ax.set_xlabel("time [min]")
    plot_all(scan_res, 80, axes)
    for ax, let in zip(axes, lets):
        if let in "bdf":
            ax.text(-0.17,
                    1.02,
                    "({})".format(let),
                    transform=ax.transAxes,
                    fontsize=12)
        if let in "ace":
            ax.text(-0.25,
                    1.02,
                    "({})".format(let),
                    transform=ax.transAxes,
                    fontsize=12)

    cb_ax, kw = mpl.colorbar.make_axes(big_ax,
                                       orientation="vertical",
                                       fraction=0.15,
                                       aspect=40,
                                       pad=0.02)
    param_vals = param_val_fun(scan_res)
    cmap = plt.cm.coolwarm
    cb = aux.make_cb(cb_ax, list(param_vals), cmap, "vertical")
    cb.set_label(param_desc)
    cb.ax.set_yticklabels(param_vals)
예제 #2
0
def plot_all_scan(scan_res_double, plot_selections, unit_dict, param_val_fun, param_desc):
    plot_all = get_plot_all_fun(unit_dict)
    lets = [x for x in "cba"]
    fig, big_ax = plt.subplots()
    aux.clean_big_ax(big_ax)
    inset_dict = aux.get_inset_loc(nx=2, ny=3, hs=0.02, vs=0.05)
    st_axes = [big_ax.inset_axes(inset_dict[key]) for key in inset_dict if key[0] == "0"]
    sf_axes = [big_ax.inset_axes(inset_dict[key]) for key in inset_dict if key[0] == "1"]
    axes_double = [st_axes, sf_axes]
    big_ax.set_xlabel("time [min]")
    plot_all(scan_res_double, plot_selections, 80, axes_double)
    st_axes[2].set_title("stress sensing")
    sf_axes[2].set_title("plain")
    for ax in sf_axes:
        ax.set_ylabel(None)
        ax.set_yticklabels([])

    for ax, let in zip(st_axes, lets):
        ax.text(-0.25, 1.02, "({})".format(let), transform=ax.transAxes, fontsize=12)

    for ax_st, ax_sf in zip(st_axes, sf_axes):
        y_lim = max(ax_st.get_ylim()[1], ax_sf.get_ylim()[1])
        ax_st.set_ylim(top=y_lim)
        ax_sf.set_ylim(top=y_lim)
        for ax in [ax_st, ax_sf]:
            aux.make_grid(ax)
    cb_ax, kw = mpl.colorbar.make_axes(big_ax, orientation="vertical", fraction=0.15, aspect=40, pad=0.02)
    param_vals = param_val_fun(scan_res_double[0])
    cmap = plt.cm.coolwarm
    cb = aux.make_cb(cb_ax, list(param_vals), cmap, "vertical")
    cb.set_label(param_desc)
    cb.ax.set_yticklabels(param_vals)
def plot_tv(result_df: pd.DataFrame, param_desc, vol_range, param_val_fun):
    fig, ax = plt.subplots(1, 1, figsize=(6, 4))
    aux.clean_big_ax(ax)
    gs = aux.loc(nrows=1, ncols=2, hs=0.1, vs=0, width_ratios=(1 / 2, 1 / 2))
    tax, vax = [ax.inset_axes(gs[0, i]) for i in range(gs.shape[1])]
    pvb.plot_vdiv_y_multi(result_df, "v_trans", vax)
    pvb.plot_vdiv_y_multi(result_df, "t_g1", tax)
    pad = 0.05 * (vol_range[-1] - vol_range[0])
    vax.set_xlim(vol_range[0] - pad, vol_range[-1] + pad)
    cb_ax, kw = mpl.colorbar.make_axes(ax, fraction=0.15, aspect=25, pad=0.02)
    param_vals = param_val_fun(scan_results)
    cb = aux.make_cb(ax=cb_ax,
                     values=param_vals,
                     cmap=mpl.cm.coolwarm,
                     orientation="vertical")
    cb.ax.set_yticklabels(param_vals)
    cb.set_label(param_desc)
def plot_all(scan_res, selections, plot_selections, unit_dict, tt=100):
    plot_all = get_plot_all_fun(selections, plot_selections, unit_dict)
    fig, big_ax = plt.subplots(figsize=(7, 7))
    aux.clean_big_ax(big_ax)
    inset_dict = aux.get_inset_loc(nx=2, ny=3, hs=0.1, vs=0.05)
    axes = [big_ax.inset_axes(inset_dict[key]) for key in inset_dict]
    big_ax.set_xlabel("time [min]")
    plot_all(scan_res, tt, axes)
    cb_ax, kw = mpl.colorbar.make_axes(big_ax,
                                       orientation="vertical",
                                       fraction=0.15,
                                       aspect=40,
                                       pad=0.02)
    param_vals = [round(sr[0], 2) for sr in scan_res]
    cmap = plt.cm.coolwarm
    cb = aux.make_cb(cb_ax, list(param_vals), cmap, "vertical")
    cb.set_label("volume after division [fL]")
    cb.ax.set_yticklabels(param_vals)
예제 #5
0
def plot_all_scan(scan_res, plot_selections, unit_dict, param_val_fun,
                  param_desc):
    fig, big_ax = plt.subplots()
    aux.clean_big_ax(big_ax)
    inset_dict = aux.get_inset_loc(nx=2, ny=1, hs=0.08, vs=0.05)
    axes = [big_ax.inset_axes(inset_dict[key]) for key in inset_dict]
    big_ax.set_xlabel("time [min]")
    plot_whi3p_stress(axes, plot_selections, unit_dict, scan_res, 80)
    axes[0].set_ylabel(unit_dict[plot_selections[0]])

    #     if let in "bdf":
    #         ax.text(-0.17, 1.02, "({})".format(let), transform = ax.transAxes, fontsize=12)
    #     if let in "ace":
    #         ax.text(-0.25, 1.02, "({})".format(let), transform = ax.transAxes, fontsize=12)

    for ax in axes:
        aux.make_grid(ax)
    cb_ax, kw = mpl.colorbar.make_axes(big_ax,
                                       orientation="vertical",
                                       fraction=0.15,
                                       aspect=40,
                                       pad=0.02)
    param_vals = param_val_fun(scan_res)
    cmap = plt.cm.coolwarm
    cb = aux.make_cb(cb_ax, list(param_vals), cmap, "vertical")
    cb.set_label(param_desc)
    cb.ax.set_yticklabels(param_vals)
    axes[1].text(-0.15,
                 1.02,
                 "({})".format("b"),
                 transform=axes[1].transAxes,
                 fontsize=12)
    axes[0].text(-0.25,
                 1.02,
                 "({})".format("a"),
                 transform=axes[0].transAxes,
                 fontsize=12)
예제 #6
0
                               pad=0.06) for ax in fig.axes
    ]
    cb_axes = [cb[0] for cb in cbs]

    ### kg scan
    kgs = aux.get_rates_from_p_scan(scans[2])
    kpCln3 = [scan[0] for scan in scans[1]]
    kpCln12 = ["off", "on"]
    vals = [kpCln12, kpCln3, kgs]

    cmaps = [
        mpl.colors.LinearSegmentedColormap.from_list("", list(color_t))
        for color_t in colors
    ]
    colorbars = [
        aux.make_cb(cb_ax, val, cmap, "horizontal")
        for cb_ax, val, cmap in zip(cb_axes, vals, cmaps)
    ]
    labels = [
        "Cln12 positive feedback", "Cln3 prod. rate [a.u./s]",
        "G1 growth rate [fL/min]"
    ]
    for cb, label, val in zip(colorbars, labels, vals):
        cb.set_label(label)
        cb.ax.set_xticklabels(val)
        cb.ax.xaxis.set_label_position('top')

    lets = "abc"
    xs = [-0.06, -0.06, -0.06]
    for ax, let, x in zip(whi5_axes, lets, xs):
        ax.set_xticklabels([])