Skip to content

Commit cb1f08e

Browse files
authored
Include id in plot titles (#2999)
* When plotting trajectories, include `ReturnData.id` in the title if set. * Set `amici.plotting.__all__`
1 parent 7f8bc18 commit cb1f08e

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

python/sdist/amici/plotting.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717
from . import Model, ReturnDataView
1818
from .numpy import StrOrExpr, evaluate
1919

20+
__all__ = [
21+
"plot_state_trajectories",
22+
"plot_observable_trajectories",
23+
"plot_jacobian",
24+
"plot_expressions",
25+
]
26+
2027

2128
def plot_state_trajectories(
2229
rdata: ReturnDataView,
@@ -73,7 +80,11 @@ def plot_state_trajectories(
7380
ax.set_xlabel("$t$")
7481
ax.set_ylabel("$x(t)$")
7582
ax.legend()
76-
ax.set_title("State trajectories")
83+
84+
title = "State trajectories"
85+
if rdata.id:
86+
title += f" – {rdata.id}"
87+
ax.set_title(title)
7788

7889

7990
def plot_observable_trajectories(
@@ -158,9 +169,13 @@ def plot_observable_trajectories(
158169

159170
ax.set_xlabel("$t$")
160171
ax.set_ylabel("$y(t)$")
161-
ax.set_title("Observable trajectories")
162172
ax.legend()
163173

174+
title = "Observable trajectories"
175+
if rdata.id:
176+
title += f" – {rdata.id}"
177+
ax.set_title(title)
178+
164179

165180
def plot_jacobian(rdata: ReturnDataView):
166181
"""Plot Jacobian as heatmap."""

0 commit comments

Comments
 (0)