GiulioRossetti / ndlib

Network Diffusion Library - (for NetworkX and iGraph)
http://ndlib.readthedocs.io/
BSD 2-Clause "Simplified" License
277 stars 80 forks source link

Individual Trajectories #255

Closed SaicharanRitwik39 closed 7 months ago

SaicharanRitwik39 commented 7 months ago

Is it possible to visualize individual trajectories? For example: Suppose in the following code, I get the dynamics of 4 compartments.

Simulation execution

model.set_initial_status(config) iterations = model.iteration_bunch(200) trends = model.build_trends(iterations)

viz = DiffusionTrend(model, trends) viz.plot()

How can I just visualize one of the trajectories?

GiulioRossetti commented 7 months ago

You can use the TrendComparison plot passing a single model, its trends, and specifying the compartment(s) you are interested in (the default is 'Infected').

SaicharanRitwik39 commented 7 months ago

Thank you so much! It worked.