From c19989753861fcefb3ff03efec0e6091f792dd81 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Thu, 3 Oct 2024 11:36:15 +0200 Subject: [PATCH] Doc: demonstrate plotting measurements (#2523) It seems, the documentation didn't demonstrate how to plot measurements together with the model outputs yet. --- .../ExampleSteadystate.ipynb | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/python/examples/example_steadystate/ExampleSteadystate.ipynb b/python/examples/example_steadystate/ExampleSteadystate.ipynb index d9f6ae635d..147ae473b6 100644 --- a/python/examples/example_steadystate/ExampleSteadystate.ipynb +++ b/python/examples/example_steadystate/ExampleSteadystate.ipynb @@ -392,10 +392,10 @@ "source": [ "model = model_module.getModel()\n", "\n", - "print(\"Model name: \", model.getName())\n", - "print(\"Model parameters:\", model.getParameterIds())\n", - "print(\"Model outputs: \", model.getObservableIds())\n", - "print(\"Model states: \", model.getStateIds())" + "print(\"Model name: \", model.getName())\n", + "print(\"Model parameters: \", model.getParameterIds())\n", + "print(\"Model outputs: \", model.getObservableIds())\n", + "print(\"Model state variables: \", model.getStateIds())" ] }, { @@ -985,6 +985,21 @@ "print(\"Log-likelihood %f\" % rdata[\"llh\"])" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": "The provided measurements can be visualized together with the simulation results by passing the `Expdata` to `amici.plotting.plot_observable_trajectories`:" + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "amici.plotting.plot_observable_trajectories(rdata, edata=edata)\n", + "plt.legend(loc=\"center left\", bbox_to_anchor=(1.04, 0.5))" + ] + }, { "cell_type": "markdown", "metadata": {},