Skip to content

Commit

Permalink
docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRossetti committed Jul 27, 2017
1 parent 5bc2c0b commit f8a7660
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
Binary file added docs/reference/utils/diffusion.pdf
Binary file not shown.
27 changes: 26 additions & 1 deletion docs/reference/utils/multiple_run.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,29 @@ Example
# Simulation multiple execution
infection_sets = [(1, 2, 3, 4, 5), (3, 23, 22, 54, 2), (98, 2, 12, 26, 3), (4, 6, 9) ]
trends = multi_runs(model1, execution_number=2, iteration_number=100, infection_sets=infection_sets, nprocesses=4)
trends = multi_runs(model1, execution_number=2, iteration_number=100, infection_sets=infection_sets, nprocesses=4)
**Plot multiple executions**

The ``ndlib.viz.mpl`` package offers support for visualization of multiple runs.

In order to visualize the average trend/prevalence along with its inter-percentile range use the following pattern (assuming ``model1`` and ``trends`` be the results of the previous code snippet).


.. code-block:: python
from ndlib.viz.mpl.DiffusionTrend import DiffusionTrend
viz = DiffusionTrend(model1, trends)
viz.plot("diffusion.pdf", percentile=90)
where ``percentile`` identifies the upper and lower bound (e.g. setting it to 90 implies a range 10-90).

The same pattern can be also applied to comparison plots.


.. figure:: diffusion.png
:scale: 80 %
:align: center
:alt: Multiple run visualization

Multiple run visualization.

0 comments on commit f8a7660

Please sign in to comment.