From 1f5331db699f9e1e907d6ba80c1882afe5acfec6 Mon Sep 17 00:00:00 2001
From: Lars Hubatsch <hubatsch@pks.mpg.de>
Date: Mon, 26 Oct 2020 10:28:48 +0100
Subject: [PATCH] Plotting: adding first Fig4 panels.

---
 Plots_Droplet_FRAP.ipynb | 73 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 70 insertions(+), 3 deletions(-)

diff --git a/Plots_Droplet_FRAP.ipynb b/Plots_Droplet_FRAP.ipynb
index 0e860b0..91fc4ab 100644
--- a/Plots_Droplet_FRAP.ipynb
+++ b/Plots_Droplet_FRAP.ipynb
@@ -24,7 +24,8 @@
     "sns.set_style(\"ticks\")\n",
     "rcParams['axes.linewidth'] = 0.75\n",
     "rcParams['xtick.major.width'] = 0.75\n",
-    "rcParams['ytick.major.width'] = 0.75"
+    "rcParams['ytick.major.width'] = 0.75\n",
+    "rcParams['text.usetex']=True"
    ]
   },
   {
@@ -39,7 +40,8 @@
     "pl.rcParams.update(params)\n",
     "\n",
     "def nice_fig(xla, yla, xli, yli, size, fs=12): \n",
-    "    rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\n",
+    "#     rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\n",
+    "    rc('font',**{'family':'serif','serif':['Palatino']})\n",
     "    plt.gcf().set_size_inches(size[0], size[1])\n",
     "    plt.xlabel(xla,fontsize=fs)  \n",
     "    plt.ylabel(yla,fontsize=fs)\n",
@@ -296,7 +298,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "## Figure 1:"
+    "### Figure 1: Fitting $D_{in}$ and data analysis."
    ]
   },
   {
@@ -448,6 +450,71 @@
     "save_nice_fig(fol+'Fig1/tot_recov.pdf')"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Figure 4: Obtaining info about outside."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "**Panel: Partitioning vs. $D_{out}$, showcasing four different simulation start cases.**"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "P_Do = np.loadtxt(fol+'/Fig4/Part_vs_Do.csv', delimiter=',')\n",
+    "P = [5, 150, 5, 150]\n",
+    "D_o = [0.1, 0.1, 1, 1]\n",
+    "plt.gca().set_prop_cycle(None)\n",
+    "nice_fig('Partitioning P', '$D_{out}$ [$\\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",
+    "           ['0.2', '0.02', '0.0067', '0.00067'], ncol=2, frameon=False,\n",
+    "               title=r'\\underline{$D_{out}$/P [$\\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 $\\mu m^2/s$', [1,40], c='grey')\n",
+    "plt.xticks([1, 10, 100]);\n",
+    "save_nice_fig(fol+'Fig4/D_vs_P.pdf')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "**Panel: Cost function**"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "P_Cost = np.loadtxt(fol+'/Fig4/Part_vs_Cost.csv', delimiter=',')\n",
+    "nice_fig('Partitioning P', 'Cost function [a.u.]', [0.9,320], [0.000000001,0.01], [2.3,2])\n",
+    "lines = plt.loglog(P_Cost[0, :], P_Cost[1:, :].transpose())\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'\\underline{$D_{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')"
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": null,
-- 
GitLab