示例#1
0
文件: basic.py 项目: argju/cgptoolbox
def summarize(gt, agg):
    """Scatterplot matrix of aggregated phenotypes vs genotypes."""
    for i, ai in enumerate(agg.dtype.names):
        for j, gj in enumerate(gt.dtype.names):
            spij(len(agg.dtype.names), len(gt.dtype.names), i, j)
            plt.plot(gt[gj], agg[ai], 'o')
            xmin, xmax, ymin, ymax = plt.axis()
            ypad = 0.1 * (ymax - ymin)
            plt.axis([xmin - 0.5, xmax + 0.5, -ypad, ymax + ypad])
            plt.axis()
            if i == len(agg.dtype) - 1:
                plt.xlabel(gj)
            if j == 0:
                plt.ylabel(ai)
    tweak_legend()
    title("Variable gap protocol, I_CaL")


### List of models

def model(name):
    def result():
        plt.title(name)
        axis("off")
    return result

mod = [model(i) 
    for i in "Hodgkin-Huxley FitzHugh-Nagumo Luo-Rudy Bondarenko".split()]
exp = [exp_pace, exp_p1p2, exp_vargap]
vis = [vis_ap, vis_ct, vis_p1p2, vis_vargap]

panels = mod, exp, vis

m = max([len(i) for i in panels])
n = len(panels)

plt.figure()
for j, panelj in enumerate(panels):
    for i, panelij in enumerate(panelj):
        # spij(m, n, i, j)
        spij(n, m, j, i)
        panelij()

plt.show()