Exemple #1
0
        ((1. / (X + 1))**b - (1. / 10)**b) / (1 - (1. / 10)**b)
    ])
}
# 3: np.array([np.arange(0.1,1,0.1), np.log(np.arange(0.1,1,0.1))])}
label = {
    1: "Ideal Classifier",
    2: "Random Classifier",
    3: "Typical Classifier"
}

for n in [1, 2, 3]:
    ax.plot(data[n][2], data[n][1], '-o', color=c[n - 1], label=label[n])
ax.fill_between(data[3][2], data[3][1], color=c[2], alpha=0.2)
ax.legend(loc="best", prop={'size': 12})
my_plot.despine(ax)
my_plot.setAxisSizeMM(fig, ax, 147, 90)
plt.savefig("/home/alex/Desktop/Mock_ROC.pdf")
plt.savefig("/home/alex/Desktop/Mock_ROC.png")

fig, ax = plt.subplots()
ax.set_xlim([-0.05, 9.05])
ax.set_ylim([-0.05, 1.05])
ax.set_xlabel("Classifier Parameter")
ax.set_ylabel("True Positive Rate")
plts = []
for n in [1, 2, 3]:
    p, = ax.plot(data[n][0],
                 data[n][1],
                 '-o',
                 color=c[n - 1],
                 label=label[n].split(" ")[0])
color = [("red" if m else "green") for m in motile]
motile = np.array(motile, dtype=bool)
fig, ax = plt.subplots()
ax.set_title("Motility of T-Cells")
ax.set_xlabel(
    r"Average Speed of Cell in $\frac{\mathrm{\mu m}}{\mathrm{min}}$")
ax.set_ylabel(r"Average Turning Angle in Degrees")
# ax.set_xlim([2,100])
# ax.set_ylim([40,140])
ax.semilogx()
# ax.scatter(v*60,ang,label="System Tracks")
ax.scatter(60 * v[motile], ang[motile], label="System Tracks (motile)")
ax.scatter(60 * v[~motile], ang[~motile], label="System Tracks (immotile)")
ax.legend(loc="best")
my_plot.despine(ax)
my_plot.setAxisSizeMM(fig, ax, width=147, height=90)
plt.savefig("/home/alex/Desktop/Cell_Classification.png")
plt.savefig("/home/alex/Desktop/Cell_Classification.pdf")
# plt.semilogx()

fig, ax = plt.subplots()
ax.set_title("Velocity of T-Cells")
ax.set_ylabel("Absolute Frequency")
ax.set_xlabel(r"Velocity in $\frac{\mathrm{\mu m}}{\mathrm{min}}$")
hist, bins = np.histogram(np.log(V * 60), bins=200, range=np.log([1e-3, 1e2]))
ax.hist(V * 60, bins=np.exp(bins))
ax.semilogx()

fig, ax = plt.subplots()
ax.set_title("Velocity of T-Cells")
ax.set_ylabel("Absolute Frequency")
Exemple #3
0
                min(biny), max(biny)]),
              extent=[-max(binx), -min(binx),
                      min(biny), max(biny)])
    hist_plot = ax.imshow(
        hist.T[::-1, ::-1],
        extent=[-max(binx), -min(binx),
                min(biny), max(biny)],
        cmap="jet",
        alpha=0.4,
        vmin=1.,
        vmax=max(2,
                 np.nanmean(hist) + np.nanstd(hist)))
    cbar = fig.colorbar(hist_plot)
    cbar.ax.set_ylabel(
        r"Penguin Probability in $\frac{1}{\mathrm{m}^2\mathrm{h}}$")
    my_plot.setAxisSizeMM(fig, ax, 147)
    plt.savefig("/home/birdflight/Desktop/Heat_Map.png")
    plt.savefig("/home/birdflight/Desktop/Heat_Map.pdf")

    fig, ax = plt.subplots()
    ax.set_title("Position Heatmap")
    # ax.set_xlabel("X-Distance to camera in m")
    # ax.set_ylabel("Y-Distance to camera in m")
    ax.imshow(image[::-1])
    hist_plot = ax.imshow(
        hist_img.T, extent=[0, 4608, 0, 2592], cmap="jet",
        alpha=.4)  #,vmin =1., vmax=max(2,np.nanmean(hist)+np.nanstd(hist)))
    # cbar = fig.colorbar(hist_plot)
    # cbar.ax.set_ylabel(r"Penguin Probability in $\frac{1}{\mathrm{m}^2\mathrm{h}}$")
    my_plot.setAxisSizeMM(fig, ax, 147)
    plt.savefig("/home/birdflight/Desktop/Heat_Map_Img.png")