diff --git a/Plots_Droplet_FRAP.ipynb b/Plots_Droplet_FRAP.ipynb index 5f1b226a7790d77381cbb68b2c3d9167ddedb48e..15f06f243d6f662cb7201285466464d3983b1184 100644 --- a/Plots_Droplet_FRAP.ipynb +++ b/Plots_Droplet_FRAP.ipynb @@ -60,8 +60,8 @@ " plt.ylim(yli)\n", " plt.tick_params(axis='both', which='major', labelsize=fs)\n", "\n", - "def save_nice_fig(name, form='pdf'):\n", - " plt.savefig(name, format=form, dpi=300, bbox_inches='tight',\n", + "def save_nice_fig(name, form='pdf', dpi=300):\n", + " plt.savefig(name, format=form, dpi=dpi, bbox_inches='tight',\n", " transparent=True)" ] }, @@ -184,7 +184,7 @@ "metadata": {}, "outputs": [], "source": [ - "nice_fig('time $t$ [s]', 'intensity (a.u)', [0,4], [0,1.05], [1.5,2])\n", + "nice_fig('time $t$ [s]', 'intensity [a.u.]', [0,4], [0,1.05], [1.5,2])\n", "plt.plot(np.linspace(0, (f_i[0].T-1)*f_i[0].dt, f_i[0].T), \n", " [np.mean(x)/f_i[0].phi_tot_int for x in profs[0]],\n", " lw=2, label='d=0.5', ls='-')\n", @@ -422,6 +422,7 @@ "fig, ax1 = plt.subplots()\n", "ax2 = ax1.twinx()\n", "plt.sca(ax1)\n", + "nice_fig('c_\\mathrm{salt} [\\mathrm{mM}]', '$\\eta^{-1} \\;[Pa\\cdot s]^{-1}$', [40,190], [0,7.24], [2.3,2])\n", "sns.lineplot(x=\"conc\", y=\"D\", data=lars, color=sns.color_palette()[1])\n", "sns.scatterplot(x=\"conc\", y=\"D\", data=lars, color=sns.color_palette()[1], alpha=0.8)\n", "plt.xlabel('$c_\\mathrm{salt}\\; [\\mathrm{mM}]$')\n", @@ -432,11 +433,10 @@ "ax1.patch.set_visible(False)\n", "plt.sca(ax2)\n", "sns.lineplot(x=\"conc\", y=\"vis\", data=louise, color=grey, label='data from Jawerth \\net al. 2018')\n", - "nice_fig('c_\\mathrm{salt} [\\mathrm{mM}]', '$\\eta^{-1} \\;[Pa\\cdot s]^{-1}$', [40,190], [0,7.24], [2.3,2])\n", - "plt.yticks(color = grey)\n", - "plt.ylabel('$\\eta^{-1} \\;[\\mathrm{Pa\\cdot s}]^{-1}$ ', color = grey)\n", + "plt.yticks(color = grey, fontsize=12)\n", + "plt.ylabel('$\\eta^{-1} \\;[\\mathrm{Pa\\cdot s}]^{-1}$ ', color = grey, fontsize=12)\n", "plt.legend(frameon=False, fontsize=9)\n", - "save_nice_fig(fol+'Fig1/Lars_vs_Louise.pdf')" + "# save_nice_fig(fol+'Fig1/Lars_vs_Louise.pdf')" ] }, { @@ -493,13 +493,13 @@ "metadata": {}, "outputs": [], "source": [ - "CMD = np.loadtxt(fol+'/Fig1/CMD_timecourse.csv', delimiter=',')\n", - "CMD_fit = np.loadtxt(fol+'/Fig1/CMD_fit_timecourse.csv', delimiter=',')\n", - "l_sim = plt.plot(CMD[:, 0], CMD[:, 1::2], '.', c=green)\n", - "l_fit = plt.plot(CMD_fit[:, 0], CMD_fit[:, 1::2], '-', lw=1, c='k')\n", + "CMD = np.loadtxt(fol+'/Fig1/CMD_timecourse_D.csv', delimiter=',')\n", + "CMD_fit = np.loadtxt(fol+'/Fig1/CMD_fit_timecourse_D.csv', delimiter=',')\n", + "l_sim = plt.plot(CMD[:, 0], CMD[:, 1::40], '.', c=green)\n", + "l_fit = plt.plot(CMD_fit[:, 0], CMD_fit[:, 1::40], '-', lw=1, c='k')\n", "plt.plot(range(0, 10), np.ones(10)*np.min(CMD_fit[:, 1]), linestyle='--', color=grey, lw=1.5)\n", "plt.legend([l_sim[0], l_fit[0]], ['data', 'fit'], ncol=2, loc=(0, 0.85), frameon=False)\n", - "nice_fig('radial distance $r$ [$\\mathrm{\\mu m}$]', 'intensity (a.u)', [0,np.max(CMD_fit[:, 0])], [0,0.65], [2.3,2])\n", + "nice_fig('radial distance $r$ [$\\mathrm{\\mu m}$]', 'intensity [a.u.]', [0,np.max(CMD_fit[:, 0])], [0,0.65], [2.3,2])\n", "save_nice_fig(fol+'Fig1/CMD_spat_recov.pdf')" ] }, @@ -516,13 +516,13 @@ "metadata": {}, "outputs": [], "source": [ - "PGL = np.loadtxt(fol+'/Fig1/PGL_timecourse.csv', delimiter=',')\n", - "PGL_fit = np.loadtxt(fol+'/Fig1/PGL_fit_timecourse.csv', delimiter=',')\n", - "l_sim = plt.plot(PGL[:, 0], PGL[:, 1::2], '.', c=red)\n", - "l_fit = plt.plot(PGL_fit[:, 0], PGL_fit[:, 1::2], '-', lw=1, c='k')\n", + "PGL = np.loadtxt(fol+'/Fig1/PGL_timecourse_D.csv', delimiter=',')\n", + "PGL_fit = np.loadtxt(fol+'/Fig1/PGL_fit_timecourse_D.csv', delimiter=',')\n", + "l_sim = plt.plot(PGL[:, 0], PGL[:, 1::130], '.', c=red)\n", + "l_fit = plt.plot(PGL_fit[:, 0], PGL_fit[:, 1::130], '-', lw=1, c='k')\n", "plt.plot(range(0, 10), np.ones(10)*np.min(PGL_fit[:, 1]), linestyle='--', color=grey, lw=1.5)\n", "plt.legend([l_sim[0], l_fit[0]], ['data', 'fit'], ncol=2, loc=(0.015, 0.865), frameon=False)\n", - "nice_fig('radial distance $r$ [$\\mathrm{\\mu m}$]', 'intensity (a.u)', [0,np.max(PGL_fit[:, 0])], [0, 0.7], [2.3,2])\n", + "nice_fig('radial distance $r$ [$\\mathrm{\\mu m}$]', 'intensity [a.u.]', [0,np.max(PGL_fit[:, 0])], [0, 0.65], [2.3,2])\n", "save_nice_fig(fol+'Fig1/PGL_spat_recov.pdf')" ] }, @@ -546,7 +546,7 @@ "metadata": {}, "outputs": [], "source": [ - "l_sim = plt.plot(PGL[:, 0], PGL[:, 4], '-', c=red)\n", + "l_sim = plt.plot(PGL[:, 0], PGL[:, 4*80], '-', c=red)\n", "nice_fig('', '', [0,np.max(PGL_fit[:, 0])], [0, 0.55], [0.7,0.7], fs=5)\n", "plt.yticks([0, 0.5], ['', ''])\n", "plt.xticks([0, 3], ['', ''])\n", @@ -560,7 +560,7 @@ "metadata": {}, "outputs": [], "source": [ - "l_sim = plt.plot(PGL[:, 0], PGL[:, 7], '-', c=red)\n", + "l_sim = plt.plot(PGL[:, 0], PGL[:, 7*80], '-', c=red)\n", "nice_fig('', '', [0,np.max(PGL_fit[:, 0])], [0, 0.55], [0.7,0.7], fs=5)\n", "plt.yticks([0, 0.5], ['', ''])\n", "plt.xticks([0, 3], ['', ''])\n", @@ -568,6 +568,51 @@ "save_nice_fig(fol+'Fig1/PGL_spat_510.pdf')" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Supplement: movie PLYS**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "PLYS = np.loadtxt(fol+'/Fig1/PLYS_timecourse_D.csv', delimiter=',')\n", + "PLYS_fit = np.loadtxt(fol+'/Fig1/PLYS_fit_timecourse_D.csv', delimiter=',')\n", + "CMD = np.loadtxt(fol+'/Fig1/CMD_timecourse_D.csv', delimiter=',')\n", + "CMD_fit = np.loadtxt(fol+'/Fig1/CMD_fit_timecourse_D.csv', delimiter=',')\n", + "PGL = np.loadtxt(fol+'/Fig1/PGL_timecourse_D.csv', delimiter=',')\n", + "PGL_fit = np.loadtxt(fol+'/Fig1/PGL_fit_timecourse_D.csv', delimiter=',')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "zipped = zip([PLYS, CMD, PGL], [PLYS_fit, CMD_fit, PGL_fit],\n", + " [blue, green, red], ['PLYS/ATP', 'CMD/PLYS', 'PGL-3'],\n", + " [0.9, 0.7, 0.8])\n", + "for mov, mov_fit, c, l, yl in zipped:\n", + " for i in range(np.shape(mov)[1]-1):\n", + " l_sim = plt.plot(mov[:, 0], mov[:, 1+i], '-', c=c)\n", + " l_fit = plt.plot(mov_fit[:, 0], mov_fit[:, 1+i], '-', lw=1, c='k')\n", + " plt.plot(range(0, 10), np.ones(10)*np.min(mov_fit[:, 1]), linestyle='--', color=grey, lw=1.5)\n", + " plt.legend([l_sim[0], l_fit[0]], [l, 'Fit to Eq. (1)'], ncol=2, loc=(0, 0.85), frameon=False,\n", + " columnspacing=0.8, handletextpad=0.5, handlelength=0.65)\n", + " nice_fig('radial distance $r$ [$\\mathrm{\\mu m}$]', 'intensity [a.u.]', [0,np.max(mov_fit[:, 0])], [0, yl], [2.3,2])\n", + " plt.yticks([0.2, 0.4, 0.6])\n", + " if l=='PLYS/ATP':\n", + " plt.yticks([0.2, 0.4, 0.6, 0.8])\n", + " save_nice_fig(fol+'Fig4/Movies/'+l[:3]+'_spat_recov_mov_'+str(i)+'.png', form='png', dpi=149.5)\n", + " plt.show();" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -587,7 +632,7 @@ "# fig, ax1 = plt.subplots()\n", "# ax2 = ax1.twiny()\n", "# plt.sca(ax1)\n", - "nice_fig('$t/T_\\mathrm{max}$', 'intensity (a.u)', [0,200], [0,0.62], [2.3,2])\n", + "nice_fig('$t/T_\\mathrm{max}$', 'intensity [a.u.]', [0,200], [0,0.62], [2.3,2])\n", "# plt.sca(ax2)\n", "# ax2.tick_params(axis=\"x\",direction=\"in\")\n", "plt.plot(PGL[::10, 0]/np.max(PGL[1:-1:2, 0]), PGL[::10,1], '.', label='PGL-3', c='#CC406E', markersize=3, alpha=0.7, lw=2)\n", @@ -619,7 +664,7 @@ "metadata": {}, "outputs": [], "source": [ - "nice_fig('time $t$ [s]', 'intensity (a.u)', [0,140], [0,0.82], [1,2])\n", + "nice_fig('time $t$ [s]', 'boundary intensity', [0,140], [0,0.82], [1,2])\n", "temp = sns.color_palette()\n", "sns.set_palette(sns.color_palette(\"rocket\", 9))\n", "# plt.sca(ax2)\n", @@ -642,7 +687,7 @@ "metadata": {}, "outputs": [], "source": [ - "nice_fig('time $t$ [s]', 'intensity (a.u)', [0,10], [0,0.72], [1,2])\n", + "nice_fig('time $t$ [s]', 'intensity [a.u.]', [0,10], [0,0.72], [1,2])\n", "plt.plot(ATP[::1, 0], ATP[::1,1], '-', label='PLYS/ATP', c=blue, markersize=3, alpha=0.7, lw=1.5)\n", "plt.plot(CMD[::5, 0], CMD[::5,1], '-', label='CMD/PLYS', c=green, markersize=3, alpha=0.7, lw=1.5)\n", "plt.legend(frameon=False, fontsize=7, loc=(0.1, 0), handletextpad=0.5)\n", @@ -773,12 +818,15 @@ "source": [ "CMD = np.loadtxt(fol+'Fig4/CMD_timecourse.csv', delimiter=',')\n", "CMD_fit = np.loadtxt(fol+'Fig4/CMD_fit_timecourse.csv', delimiter=',')\n", - "l_data = plt.plot(CMD[:, 0], CMD[:, 1:], c=green, lw=2,\n", + "CMD_t = np.loadtxt(fol+'Fig4/CMD_fit_time.csv', delimiter=',')\n", + "l_data = plt.plot(CMD[:, 0], CMD[:, 1::30], c=green, lw=2,\n", " label='Experiment')\n", - "l_fit = plt.plot(CMD_fit[:, 0], CMD_fit[:, 1:], '-', lw=1,\n", + "l_fit = plt.plot(CMD_fit[:, 0], CMD_fit[:, 2::30], '-', lw=1,\n", " c=dark_grey, label='Simulation')\n", - "nice_fig('radial distance $r$ [$\\mathrm{\\mu m}$]', 'intensity [a.u]',\n", - " [0, 2.4*np.max(CMD[:, 0])], [0,0.5], [2.3,2])\n", + "l_fit = plt.plot(CMD_fit[:, 0], CMD_fit[:, 1], '-', lw=1,\n", + " c=dark_grey) # Initial condition\n", + "nice_fig('radial distance $r$ [$\\mathrm{\\mu m}$]', 'intensity [a.u.]',\n", + " [0, 2.4*np.max(CMD[:, 0])], [0,0.7], [2.3,2])\n", "plt.legend([l_data[0], l_fit[0]], ['CMD/PLYS', 'Full model'], frameon=False,\n", " fontsize=9, handletextpad=0.4, handlelength=0.8, loc=(0.52, 0.7))\n", "save_nice_fig(fol+'Fig4/CMD_spat_recov_new.pdf')" @@ -798,11 +846,11 @@ " c=dark_grey, label='Simulation') # time course\n", "l_fit = plt.plot(PLYS_fit[:, 0], PLYS_fit[:, 1], '-', lw=1,\n", " c=dark_grey) # Initial condition\n", - "nice_fig('radial distance $r$ [$\\mathrm{\\mu m}$]', 'intensity [a.u]',\n", + "nice_fig('radial distance $r$ [$\\mathrm{\\mu m}$]', 'intensity [a.u.]',\n", " [0, 2.4*np.max(PLYS[:, 0])], [0,0.75], [2.3,2])\n", - "plt.legend([l_data[0], l_fit[0]], ['ATP/PLYS', 'Full model'], frameon=False,\n", + "plt.legend([l_data[0], l_fit[0]], ['PLYS/ATP', 'Full model'], frameon=False,\n", " fontsize=9, handletextpad=0.4, handlelength=0.8, loc=(0.52, 0.7))\n", - "# save_nice_fig(fol+'Fig4/PLYS_spat_recov_new.pdf')" + "save_nice_fig(fol+'Fig4/PLYS_spat_recov_new.pdf')" ] }, { @@ -811,18 +859,20 @@ "metadata": {}, "outputs": [], "source": [ - "for i in range(np.shape(PLYS)[1]):\n", - " l_data = plt.plot(PLYS[:, 0], PLYS[:, 1+i], c=blue, lw=2)\n", - " l_fit = plt.plot(PLYS_fit[:, 0], PLYS_fit[:, 2+i], '-', lw=1,\n", - " c=dark_grey, label='Simulation') # time course\n", - " nice_fig('radial distance $r$ [$\\mathrm{\\mu m}$]', 'intensity [a.u]',\n", - " [0, 2.4*np.max(PLYS[:, 0])], [0,0.9], [2.3,2.005])\n", - " plt.legend([l_data[0], l_fit[0]], ['ATP/PLYS', 'Full model'], frameon=False,\n", - " fontsize=9, handletextpad=0.4, handlelength=0.8, loc=(0.52, 0.7))\n", - " t = str(np.round(PLYS_t[i+1], 2))\n", - " plt.text(0.5, 0.785, t.ljust(4, '0') + ' s')\n", - " save_nice_fig(fol+'Fig4/PLYSATP_mov/PLYS_spat_recov_mov_'+str(i)+'.png', form='png')\n", - " plt.show();" + "PGL = np.loadtxt(fol+'Fig4/PGL_timecourse.csv', delimiter=',')\n", + "PGL_fit = np.loadtxt(fol+'Fig4/PGL_fit_timecourse.csv', delimiter=',')\n", + "PGL_t = np.loadtxt(fol+'Fig4/PGL_fit_time.csv', delimiter=',')\n", + "l_data = plt.plot(PGL[:, 0], PGL[:, 1::140], c=red, lw=2,\n", + " label='Experiment')\n", + "l_fit = plt.plot(PGL_fit[:, 0], PGL_fit[:, 2::140], '-', lw=1,\n", + " c=dark_grey, label='Simulation')\n", + "plt.plot(PGL_fit[:, 0], PGL_fit[:, 1], '-', lw=1, c=dark_grey)\n", + "nice_fig('radial distance $r$ [$\\mathrm{\\mu m}$]', 'intensity [a.u.]',\n", + " [0, 2.7*np.max(PGL[:, 0])], [0,0.7], [2.3,2])\n", + "plt.legend([l_data[0], l_fit[0]], ['PGL-3', 'Full model'],\n", + " frameon=False, fontsize=9, handletextpad=0.4,\n", + " handlelength=0.8, loc=(0.54, 0.7))\n", + "save_nice_fig(fol+'Fig4/PGL_spat_recov.pdf')" ] }, { @@ -831,19 +881,26 @@ "metadata": {}, "outputs": [], "source": [ - "PGL = np.loadtxt(fol+'Fig4/PGL_timecourse.csv', delimiter=',')\n", - "PGL_fit = np.loadtxt(fol+'Fig4/PGL_fit_timecourse.csv', delimiter=',')\n", - "l_data = plt.plot(PGL[:, 0], PGL[:, 1::4], c=red, lw=2,\n", - " label='Experiment')\n", - "l_fit = plt.plot(PGL_fit[:, 0], PGL_fit[:, 2::4], '-', lw=1,\n", - " c=dark_grey, label='Simulation')\n", - "plt.plot(PGL_fit[:, 0], PGL_fit[: 1], '-', lw=1, c=dark_grey)\n", - "nice_fig('radial distance $r$ [$\\mathrm{\\mu m}$]', 'intensity (a.u)',\n", - " [0, 2.5*np.max(PGL[:, 0])], [0,0.65], [2.3,2])\n", - "plt.legend([l_data[0], l_fit[0]], ['PGL', 'Full model'],\n", - " frameon=False, fontsize=9, handletextpad=0.4,\n", - " handlelength=0.8, loc=(0.54, 0.7))\n", - "save_nice_fig(fol+'Fig4/PGL_spat_recov.pdf')" + "zipped = zip([PLYS, CMD, PGL], [PLYS_fit, CMD_fit, PGL_fit],\n", + " [PLYS_t, CMD_t, PGL_t], [blue, green, red],\n", + " ['PLYS/ATP', 'CMD/PLYS', 'PGL-3'], [0.9, 0.7, 0.8])\n", + "for (mov, mov_fit, mov_t, c, l, yl) in zipped:\n", + " for i in range(np.shape(mov)[1]-1):\n", + " l_data = plt.plot(mov[:, 0], mov[:, 1+i], c=c, lw=2)\n", + " l_fit = plt.plot(mov_fit[:, 0], mov_fit[:, 2+i], '-', lw=1,\n", + " c=dark_grey) # time course\n", + " nice_fig('radial distance $r$ [$\\mathrm{\\mu m}$]', 'intensity [a.u]',\n", + " [0, 2.7*np.max(mov[:, 0])], [0, yl], [2.35,2.005])\n", + " plt.legend([l_data[0], l_fit[0]], [l, 'Fit to Eq. (6)'], frameon=False,\n", + " fontsize=9, handletextpad=0.4, handlelength=0.8, loc=(0.48, 0.7))\n", + " t = str(np.round(mov_t[i+1], 2))\n", + " plt.text(0.5, yl-0.11/0.8*yl, t.ljust(4, '0') + ' s')\n", + " plt.yticks([0.2, 0.4, 0.6])\n", + " if l=='PLYS/ATP':\n", + " plt.yticks([0.2, 0.4, 0.6, 0.8])\n", + " save_nice_fig(fol+'Fig4/Movies/'+l[:3]+'_spat_recov_model_'+str(i)+'.png',\n", + " form='png', dpi=149)\n", + " plt.show();" ] }, { @@ -879,7 +936,7 @@ "ax1.set_xscale('log')\n", "nice_fig('Partition coefficient $P$', '$D_\\mathrm{out} \\;[\\mathrm{\\mu m^2s^{-1}}]$',\n", " [1,340], [0.08,450], [2.3,2])\n", - "plt.legend(['CMD/PLYS', 'ATP/PLYS'], frameon=False, fontsize=9, loc=(0.44,0.05))\n", + "plt.legend(['CMD/PLYS', 'PLYS/ATP'], frameon=False, fontsize=9, loc=(0.44,0.05))\n", "plt.text(1.1, 2, '$D_\\mathrm{in, P/A}$', color=blue)\n", "plt.text(1.1, 7, '$D_\\mathrm{in, C/P}$', color=green)\n", "# plt.plot([1, 9], [1.7, 1.7], '--', color=blue)\n", @@ -932,7 +989,8 @@ " color=sns.color_palette()[4], ci=None)\n", "l100 = sns.lineplot(x=\"P\", y=\"D_out\", data=PGL_100,\n", " color=sns.color_palette()[5], ci=None)\n", - "leg1 = plt.legend(['50 mM', '60 mM', '75 mM', '90 mM', '100 mM'],\n", + "ls = plt.gca().get_lines()\n", + "leg1 = plt.legend([ls[4], ls[3], ls[2], ls[1], ls[0]], ['100 mM', '90 mM', '75 mM', '60 mM', '50 mM'],\n", " labelspacing=0.3, loc=(0.63, 0.0),\n", " handletextpad=0.4, handlelength=0.5, frameon=0)\n", "\n", @@ -952,14 +1010,10 @@ " [1,20000], [0.0003,600], [2.3,2])\n", "plt.xticks([1, 10, 100, 1000, 10000]);\n", "plt.legend(loc=1)\n", - "plt.legend(['50 mM', '60 mM', '75 mM', '90 mM', '100 mM',\n", - " '120 mM', '150 mM', '180 mM'], labelspacing=0.3,\n", + "ls = plt.gca().get_lines()\n", + "plt.legend([ls[7], ls[6],ls[5]], ['180 mM', '150 mM', '120 mM'], labelspacing=0.3,\n", " loc=(0, 0.66), handletextpad=0.4, handlelength=0.5, frameon=0)\n", "plt.gca().add_artist(leg1)\n", - "# plt.plot([700, 10000], [30, 30], color=(1, 0, 0))\n", - "# plt.plot([700, 10000], [70, 70], color=(1, 0, 0))\n", - "# plt.plot([700, 700], [30, 70], color=(1, 0, 0))\n", - "# plt.plot([10000, 10000], [30, 70], color=(1, 0, 0))\n", "save_nice_fig(fol+'Fig4/PGL-3.pdf')\n", "sns.set_palette(temp)" ] @@ -999,7 +1053,7 @@ "salts = [50, 60, 75, 90, 100, 120, 150, 180]\n", "nice_fig('$c_\\mathrm{salt} \\; [\\mathrm{mM}]$', 'Partition coefficient $P$',\n", " [50, 180], [12,20000], [2.3,2])\n", - "plt.plot(salts, Ps_1, color=red, label='$D_{\\mathrm{out}}=1$')\n", + "plt.plot(salts, Ps_2, color=red, label='$D_{\\mathrm{out}}=2$')\n", "plt.plot(salts, Ps_10, color=green, label='$D_{\\mathrm{out}}=10$')\n", "plt.plot(salts, Ps_50, color=blue, label='$D_{\\mathrm{out}}=50$')\n", "# plt.plot(salt_anatol, P_anatol)\n", @@ -1045,15 +1099,22 @@ "nice_fig('Partition coefficient $P$', '$D_\\mathrm{out}$ [$\\mathrm{\\mu m^2/s}$]', [0.9,320], [0.000001,340], [2.3,2])\n", "lines = plt.loglog(P_Do[0, :], P_Do[1:, :].transpose())\n", "plt.plot(P_Do[0, :], P_Do[0, :], '--', c='grey')\n", - "plt.legend([lines[2], lines[0], lines[3], lines[1]],\n", + "# plt.legend([lines[2], lines[0], lines[3], lines[1]],\n", + "# ['0.2', '0.02', '0.0067', '0.00067'], ncol=2, frameon=False,\n", + "# title=r'$D_\\mathrm{out}$/P [$\\mathrm{\\mu m^2/s}$]:', columnspacing=0.5, labelspacing=0.3,\n", + "# loc=(0.4, 0), handletextpad=0.4, handlelength=0.5)\n", + "plt.gca().set_prop_cycle(None)\n", + "lines[0] = plt.plot(P[0], D_o[0], 'o', mfc='none', markersize=8)\n", + "lines[1] = plt.plot(P[1], D_o[1], 'o', mfc='none', markersize=8)\n", + "lines[2] = plt.plot(P[2], D_o[2], 'o', mfc='none', markersize=8)\n", + "lines[3] = plt.plot(P[3], D_o[3], 'o', mfc='none', markersize=8)\n", + "def circle(i):\n", + " return plt.Line2D(range(1), range(1), color=sns.color_palette()[i],\n", + " marker='o', markersize=5, markerfacecolor=\"white\")\n", + "plt.legend([circle(2), circle(0), circle(3), circle(1)],\n", " ['0.2', '0.02', '0.0067', '0.00067'], ncol=2, frameon=False,\n", " title=r'$D_\\mathrm{out}$/P [$\\mathrm{\\mu m^2/s}$]:', columnspacing=0.5, labelspacing=0.3,\n", " loc=(0.4, 0), handletextpad=0.4, handlelength=0.5)\n", - "plt.gca().set_prop_cycle(None)\n", - "plt.plot(P[0], D_o[0], 'd')\n", - "plt.plot(P[1], D_o[1], 'd')\n", - "plt.plot(P[2], D_o[2], 'd')\n", - "plt.plot(P[3], D_o[3], 'd')\n", "plt.annotate('$D_{out}$/P = 1 $\\mathrm{\\mu m^2/s}$', [1,40], c='grey')\n", "plt.xticks([1, 10, 100]);\n", "save_nice_fig(fol+'Fig4/D_vs_P.pdf')" @@ -1080,7 +1141,7 @@ "# title=r'$D_\\mathrm{out}$/P set to:', columnspacing=0.5, labelspacing=0.3,\n", "# loc=(0.081, 0), handletextpad=0.4, handlelength=0.5)\n", "plt.xticks([1, 10, 100]);\n", - "save_nice_fig(fol+'Fig4/D_vs_Cost.pdf')" + "# save_nice_fig(fol+'Fig4/D_vs_Cost.pdf')" ] }, { @@ -1094,7 +1155,7 @@ "lines = plt.plot(P_Cost[0], P_Cost[1:].transpose()/[x[0] for x in P_Cost[1:]])\n", "plt.gca().set_xscale('log')\n", "plt.plot([150, 150], [0, 1], '--', lw=2, c=grey)\n", - "save_nice_fig(fol+'Fig4/D_vs_Cost_single.pdf')" + "# save_nice_fig(fol+'Fig4/D_vs_Cost_single.pdf')" ] }, { @@ -1114,8 +1175,8 @@ "levels = MaxNLocator(nbins=100).tick_values(np.log10(con[:, 2:].min()), np.log10(con[:, 2:].max()))\n", "nice_fig('Partition coefficient $P$', '$D_\\mathrm{out} \\;[\\mathrm{\\mu m^2 s^{-1}}]$', [1, 3], [-2,1], [2.3,2])\n", "CS = plt.contourf(np.log10(con[:, 0]), np.log10(con[:, 1]), np.log10(con[:, 2:]), levels=levels, cmap=cm.coolwarm)\n", - "plt.plot(np.log10(150), np.log10(10**-1), 'd', c=sns.color_palette()[1], label='Initial Simul.', markersize=6)\n", - "le = plt.legend(loc=(0, 0.83), frameon=False, handletextpad=0.4)\n", + "plt.plot(np.log10(150), np.log10(10**-1), 'o', c=sns.color_palette()[1], label='Reference Simulation', mfc='none', markersize=8)\n", + "le = plt.legend(loc=(0, 0.83), frameon=False, handletextpad=0.2)\n", "# plt.plot(np.log10(P_Do[0, :]), np.log10(P_Do[2, :].transpose()), '--', c=green, lw = 1)\n", "le.get_texts()[0].set_color('white')\n", "plt.xticks([1, 2, 3], ['$10^1$', '$10^2$', '$10^3$'])\n", diff --git a/README.md b/README.md index 903f4aeb9c28f7817edf094f43689193b3bc8a97..db0f309574e557d4cb2c2bcddad66e162dea6064 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # frap_theory -Theoretical description of droplet FRAP, starting from full ternary model. Latex description on Overleaf https://www.overleaf.com/project/5c94b05fbcbf272b27c68f2c. \ No newline at end of file +Theoretical description of droplet FRAP, starting from full ternary model.