diff --git a/Plots_Droplet_FRAP.ipynb b/Plots_Droplet_FRAP.ipynb index c09a66792e880b44a93e8ee994e5c71b0fd4630d..43a8fd549ffe20ae9866930ee55c3e03fd3bc86e 100644 --- a/Plots_Droplet_FRAP.ipynb +++ b/Plots_Droplet_FRAP.ipynb @@ -354,17 +354,17 @@ "plt.sca(ax1)\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.7)\n", - "plt.xlabel('$c_{salt}\\; [mM]$')\n", - "plt.ylabel('$D_{in} \\;[\\mu m^2\\cdot s^{-1}]$', color=sns.color_palette()[1])\n", - "plt.yticks([0, 0.05, 0.1], rotation=90, color = sns.color_palette()[1])\n", + "plt.xlabel('$c_\\mathrm{salt}\\; [\\mathrm{mM}]$')\n", + "plt.ylabel('$D_{\\mathrm{in}} \\;[\\mathrm{\\mu m^2\\cdot s^{-1}}]$', color=red)\n", + "plt.yticks([0, 0.05, 0.1], rotation=90, color = pa[1])\n", "plt.ylim(0, 0.1)\n", "ax1.set_zorder(1) \n", "ax1.patch.set_visible(False)\n", "plt.sca(ax2)\n", - "sns.lineplot(x=\"conc\", y=\"vis\", data=louise, color=sns.color_palette()[0], label='data from ref[xxx]')\n", - "nice_fig('c_{salt} [mM]', '$\\eta^{-1} \\;[Pa\\cdot s]^{-1}$', [40,190], [0,7.24], [2.3,2])\n", - "plt.yticks(color = sns.color_palette()[0])\n", - "plt.ylabel('$\\eta^{-1} \\;[Pa\\cdot s]^{-1}$ ', color = sns.color_palette()[0])\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.legend(frameon=False, fontsize=9)\n", "save_nice_fig(fol+'Fig1/Lars_vs_Louise.pdf')" ] @@ -383,24 +383,17 @@ "outputs": [], "source": [ "coacervates = pd.read_csv('/Users/hubatsch/Desktop/DropletFRAP/Latex/Figures/Fig1/Coacervates.csv')\n", - "sns.stripplot(data=coacervates, jitter=0.35, alpha=0.8,**{'marker': '.', 'size': 8, 'edgecolor': 'black', 'color': 'k'})\n", - "ax = sns.barplot(data=coacervates, facecolor=(1, 1, 1, 0), edgecolor=(0.6, 0.6, 0.6), errcolor=(0.6, 0.6, 0.6), capsize=.2, ci='sd', errwidth=1.5)\n", + "sns.stripplot(data=coacervates, palette=[green, blue], jitter=0.35,**{'marker': '.', 'size': 10})\n", + "ax = sns.barplot(data=coacervates, palette=pa, facecolor=(1, 1, 1, 0), edgecolor=[pa[0], pa[2]], capsize=.15, ci='sd', errwidth=1.5)\n", "plt.setp(ax.lines, zorder=100)\n", - "nice_fig(None, '$D_{in} \\;[\\mu m^2\\cdot s^{-1}]$', [None, None], [0,6], [2.3,2])\n", + "nice_fig(None, '$D_\\mathrm{in} \\;[\\mathrm{\\mu m^2\\cdot s^{-1}}]$', [None, None], [0,6], [2.3,2])\n", "plt.xticks([0,1], ('CMD/PLYS', 'PLYS/ATP'), rotation=20)\n", + "ax.get_xticklabels()[0].set_color(green)\n", + "ax.get_xticklabels()[1].set_color(blue)\n", "plt.xlim(-0.7, 1.7)\n", "save_nice_fig(fol+'Fig1/Coacervates.pdf')" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ax.patches" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -416,10 +409,11 @@ "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:], '#1f77b4', lw=3, label='Simulation')\n", - "l_fit = plt.plot(CMD_fit[:, 0], CMD_fit[:, 1:], '--', lw=2, c=sns.color_palette()[1], label='Simulation')\n", - "plt.plot(range(0, 10), np.ones(10)*np.min(CMD_fit[:, 1]), linestyle='--', color='k', lw=2)\n", - "nice_fig('x [$\\mu m$]', 'intensity (a.u)', [0,np.max(CMD_fit[:, 0])], [0,0.6], [2.3,2])\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", + "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('$r \\;[\\mathrm{\\mu m}$]', 'intensity (a.u)', [0,np.max(CMD_fit[:, 0])], [0,0.6], [2.3,2])\n", "save_nice_fig(fol+'Fig1/CMD_spat_recov.pdf')" ] }, @@ -438,10 +432,11 @@ "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:], '#1f77b4', lw=3, label='Simulation')\n", - "l_fit = plt.plot(PGL_fit[:, 0], PGL_fit[:, 1:], '--', lw=2, c=sns.color_palette()[1], label='Simulation')\n", - "plt.plot(range(0, 10), np.ones(10)*np.min(PGL_fit[:, 1]), linestyle='--', color='k', lw=2)\n", - "nice_fig('x [$\\mu m$]', 'intensity (a.u)', [0,np.max(PGL_fit[:, 0])], [0,None], [2.3,2])\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", + "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('$r \\;[\\mathrm{\\mu m}$]', 'intensity (a.u)', [0,np.max(PGL_fit[:, 0])], [0, 0.6], [2.3,2])\n", "save_nice_fig(fol+'Fig1/PGL_spat_recov.pdf')" ] }, @@ -467,9 +462,9 @@ "nice_fig('$t/T_{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", - "plt.plot(ATP[::1, 0]/np.max(ATP[:, 0]), ATP[::1,1], label='PLYS/ATP', c='#FF508A', markersize=3, alpha=0.7, lw=2)\n", - "plt.plot(CMD[::5, 0]/np.max(CMD[:, 0]), CMD[::5,1], label='CMD/PLYS', c='#7F2845', markersize=3, alpha=0.7, lw=2)\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", + "plt.plot(ATP[::1, 0]/np.max(ATP[:, 0]), ATP[::1,1], '.', label='PLYS/ATP', c='#FF508A', markersize=3, alpha=0.7, lw=2)\n", + "plt.plot(CMD[::5, 0]/np.max(CMD[:, 0]), CMD[::5,1], '.', label='CMD/PLYS', c='#7F2845', markersize=3, alpha=0.7, lw=2)\n", "plt.legend(frameon=False, fontsize=9)\n", "plt.xlim(0, 1)\n", "save_nice_fig(fol+'Fig1/tot_recov.pdf')" @@ -497,15 +492,15 @@ "source": [ "PLYS = np.loadtxt(fol+'Fig4/PLYS_timecourse.csv', delimiter=',')\n", "PLYS_fit = np.loadtxt(fol+'Fig4/PLYS_fit_timecourse.csv', delimiter=',')\n", - "l_data = plt.plot(PLYS[:, 0], PLYS[:, 1:], '#1f77b4', lw=3,\n", + "l_data = plt.plot(PLYS[:, 0], PLYS[:, 1:], c=blue, lw=2,\n", " label='Experiment')\n", - "l_fit = plt.plot(PLYS_fit[:, 0], PLYS_fit[:, 1:], '--', lw=2,\n", - " c=sns.color_palette()[1], label='Simulation')\n", - "nice_fig('x [$\\mu m$]', 'intensity (a.u)', [0, 2.4*np.max(PLYS[:, 0])],\n", - " [0,0.5], [2.3,2])\n", + "l_fit = plt.plot(PLYS_fit[:, 0], PLYS_fit[:, 1:], '-', lw=1,\n", + " c=dark_grey, label='Simulation')\n", + "nice_fig('$r$ [$\\mathrm{\\mu m}$]', 'intensity (a.u)', [0, 2.4*np.max(PLYS[:, 0])],\n", + " [0,0.7], [2.3,2])\n", "plt.legend([l_data[0], l_fit[0]], ['ATP/PLYS', 'Full model'], frameon=False,\n", " fontsize=9, handletextpad=0.4, handlelength=0.8)\n", - "save_nice_fig(fol+'Fig4/PLYS_spat_recov.pdf')" + "save_nice_fig(fol+'Fig4/PLYS_spat_recov_new.pdf')" ] }, { @@ -533,8 +528,8 @@ "source": [ "fig, ax1 = plt.subplots()\n", "plt.sca(ax1)\n", - "sns.lineplot(x=\"P\", y=\"D_out\", data=CMD, color=sns.color_palette()[1], ci='sd')\n", - "sns.lineplot(x=\"P\", y=\"D_out\", data=PLYS, color=sns.color_palette()[2], ci='sd')\n", + "sns.lineplot(x=\"P\", y=\"D_out\", data=CMD, color=green, ci='sd')\n", + "sns.lineplot(x=\"P\", y=\"D_out\", data=PLYS, color=blue, ci='sd')\n", "plt.plot(np.logspace(0, 2, 10), 2*np.logspace(0, 2, 10), '--', c='grey')\n", "ax1.set_yscale('log')\n", "ax1.set_xscale('log')\n", @@ -576,7 +571,6 @@ "fig, ax1 = plt.subplots()\n", "plt.sca(ax1)\n", "sns.set_palette(sns.color_palette(\"Oranges\", 9))\n", - "# sns.color_palette(\"flare\", as_cmap=True)\n", "l50 = sns.lineplot(x=\"P\", y=\"D_out\", data=PGL_50, color=sns.color_palette()[1], ci=None)\n", "l60 = sns.lineplot(x=\"P\", y=\"D_out\", data=PGL_60, color=sns.color_palette()[2], ci=None)\n", "l75 = sns.lineplot(x=\"P\", y=\"D_out\", data=PGL_75, color=sns.color_palette()[3], ci=None)\n", @@ -588,9 +582,10 @@ "l150 = sns.lineplot(x=\"P\", y=\"D_out\", data=PGL_150, color=sns.color_palette()[7], ci=None)\n", "l180 = sns.lineplot(x=\"P\", y=\"D_out\", data=PGL_180, color=sns.color_palette()[8], ci=None)\n", "plt.plot(np.logspace(0, 3, 10), 0.07*np.logspace(0, 3, 10), '--', c='grey')\n", + "# plt.plot(np.logspace(2, 3, 10), 30*np.ones(10), '--', c='m', lw=2)\n", "ax1.set_yscale('log')\n", "ax1.set_xscale('log')\n", - "nice_fig('Partitioning P', '$D_{out} \\;[\\mu m^2 s^{-1}]$', [1,1000], [0.0003,200], [2.3,2])\n", + "nice_fig('Partitioning P', '$D_{out} \\;[\\mathrm{\\mu m^2 s^{-1}}]$', [1,1000], [0.0003,200], [2.3,2])\n", "plt.xticks([1, 10, 100, 1000]);\n", "plt.legend(loc=1)\n", "plt.legend(['50 mM', '60 mM', '75 mM', '90 mM', '100 mM', '120 mM', '150 mM', '180 mM'], labelspacing=0.3,\n",