\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"
\n",
"
\n",
""
],
"text/plain": [
"Column\n",
" [0] FloatSlider(end=1000.0, name='t', step=10.1010101010101, value=1000.0)\n",
" [1] ParamFunction(function)"
]
},
"execution_count": 7,
"metadata": {
"application/vnd.holoviews_exec.v0+json": {
"id": "1281"
}
},
"output_type": "execute_result"
}
],
"source": [
"t_slider = pn.widgets.FloatSlider(\n",
" name=\"t\", start=t[0], end=t[-1], value=t[-1], step=t[1] - t[0]\n",
")\n",
"\n",
"\n",
"@pn.depends(t_slider)\n",
"def plot_turing(t_point):\n",
" i = np.searchsorted(t, t_point)\n",
"\n",
" p = bokeh.plotting.figure(\n",
" frame_width=400,\n",
" frame_height=200,\n",
" x_axis_label=\"x\",\n",
" y_axis_label=\"a, s\",\n",
" x_range=[0, L],\n",
" y_range=[0, np.concatenate(conc).max()*1.02],\n",
" )\n",
" \n",
" p.line(x, conc[0][i, :], legend_label=\"activator\", line_width=2)\n",
" p.line(\n",
" x,\n",
" conc[1][i, :],\n",
" color=\"tomato\",\n",
" legend_label=\"substrate\",\n",
" line_width=2,\n",
" )\n",
"\n",
" return p\n",
"\n",
"pn.Column(t_slider, plot_turing)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"It is useful to quickly make plots like this, so the `xyt_plot()` function is included in the biocircuits package. It generates a plot of curves that can vary over time and provides a slider to adjust the time variable."
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"