Skip to content

Commit

Permalink
update Transmission plot()
Browse files Browse the repository at this point in the history
  • Loading branch information
clorton committed Dec 9, 2024
1 parent 9cac178 commit 4a57564
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions src/laser_measles/transmission.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,25 +167,14 @@ def plot(self, fig: Figure = None):
"""

fig = plt.figure(figsize=(12, 9), dpi=128) if fig is None else fig
fig.suptitle("Cases and Incidence for Two Largest Patches")
fig.suptitle("Cases for Largest Patches")

itwo, ione = np.argsort(self.model.patches.populations[-1, :])[-2:]
ipatches = np.argsort(self.model.patches.populations[-1, :])[-1:-5:-1]

fig.add_subplot(2, 2, 1)
plt.title(f"Cases - Node {ione}") # ({self.names[ione]})")
plt.plot(self.model.patches.cases[:, ione])

fig.add_subplot(2, 2, 2)
plt.title(f"Incidence - Node {ione}") # ({self.names[ione]})")
plt.plot(self.model.patches.incidence[:, ione])

fig.add_subplot(2, 2, 3)
plt.title(f"Cases - Node {itwo}") # ({self.names[itwo]})")
plt.plot(self.model.patches.cases[:, itwo])

fig.add_subplot(2, 2, 4)
plt.title(f"Incidence - Node {itwo}") # ({self.names[itwo]})")
plt.plot(self.model.patches.incidence[:, itwo])
for ipatch in range(len(ipatches)):
fig.add_subplot(2, 2, ipatch + 1)
plt.title(f"Cases - Patch {ipatches[ipatch]}")
plt.plot(self.model.patches.cases[:, ipatches[ipatch]])

yield
return

0 comments on commit 4a57564

Please sign in to comment.