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 5595ce0 commit 1bf59de
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
3 changes: 2 additions & 1 deletion docs/reference/viz/bokeh/DiffusionPrevalence.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ Below is shown an example of Diffusion Prevalence description and visualization
# Simulation execution
iterations = model.iteration_bunch(200)
trends = model.build_trends(iterations)
# Visualization
viz = DiffusionPrevalence(model, iterations)
viz = DiffusionPrevalence(model, trends)
p = viz.plot(width=400, height=400)
show(p)
Expand Down
3 changes: 2 additions & 1 deletion docs/reference/viz/bokeh/DiffusionTrend.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ Below is shown an example of Diffusion Trend description and visualization for t
# Simulation execution
iterations = model.iteration_bunch(200)
trends = model.build_trends(iterations)
# Visualization
viz = DiffusionTrend(model, iterations)
viz = DiffusionTrend(model, trends)
p = viz.plot(width=400, height=400)
show(p)
Expand Down
5 changes: 3 additions & 2 deletions docs/reference/viz/bokeh/Multiplot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ The Multi Plot object allows the generation of composite grid figures composed b
# Simulation execution
iterations = model.iteration_bunch(200)
trends = model.build_trends(iterations)
# Diffusion Trend
viz = DiffusionTrend(model, iterations)
viz = DiffusionTrend(model, trends)
p = viz.plot(width=400, height=400)
vm.add_plot(p)
# Diffusion Prevalence
viz = DiffusionPrevalence(model, iterations)
viz = DiffusionPrevalence(model, trends)
p1 = viz.plot(width=400, height=400)
vm.add_plot(p1)
Expand Down
21 changes: 14 additions & 7 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,20 @@ In order to execute the simulation one, or more, iterations must be required usi
# Simulation
iterations = model.iteration_bunch(200)
trends = model.build_trends(iterations)
---------------------
Visualize the results
---------------------

At the end of the simulation the diffusion trend can be visualized as follows
At the end of the simulation the diffusion trend can be visualized as follows (for ``matplotlib`` change ``ndlib.viz.bokeh`` in ``ndlib.viz.mpl``)

.. code:: python
from bokeh.io import output_notebook, show
from ndlib.viz.bokeh.DiffusionTrend import DiffusionTrend
viz = DiffusionTrend(model, iterations)
viz = DiffusionTrend(model, trends)
p = viz.plot(width=400, height=400)
show(p)
Expand All @@ -92,7 +93,7 @@ The prevalence plot captures the variation (delta) of nodes for each status in c
from ndlib.viz.bokeh.DiffusionPrevalence import DiffusionPrevalence
viz2 = DiffusionPrevalence(model, iterations)
viz2 = DiffusionPrevalence(model, trends)
p2 = viz2.plot(width=400, height=400)
show(p2)
Expand All @@ -109,7 +110,7 @@ Multiple plots can be combined in a multiplot to provide a complete description
show(m)
Multiplots are also useful to compare different diffusion models applied to the same graph (as well as a same model instantiated with different parameters)
Multiplots - implemented only for the ``bokeh`` provider - are also useful to compare different diffusion models applied to the same graph (as well as a same model instantiated with different parameters)

.. code:: python
Expand All @@ -128,7 +129,9 @@ Multiplots are also useful to compare different diffusion models applied to the
config.add_model_parameter("percentage_infected", 0.05)
sis_model.set_initial_status(config)
iterations = sis_model.iteration_bunch(200)
viz = DiffusionTrend(sis_model, iterations)
trends = model.build_trends(iterations)
viz = DiffusionTrend(sis_model, trends)
p3 = viz.plot(width=400, height=400)
vm.add_plot(p3)
Expand All @@ -139,7 +142,9 @@ Multiplots are also useful to compare different diffusion models applied to the
config.add_model_parameter("percentage_infected", 0.05)
si_model.set_initial_status(config)
iterations = si_model.iteration_bunch(200)
viz = DiffusionTrend(si_model, iterations)
trends = model.build_trends(iterations)
viz = DiffusionTrend(si_model, trends)
p4 = viz.plot(width=400, height=400)
vm.add_plot(p4)
Expand All @@ -155,7 +160,9 @@ Multiplots are also useful to compare different diffusion models applied to the
config.add_model_parameter("percentage_infected", 0.30)
th_model.set_initial_status(config)
iterations = th_model.iteration_bunch(60)
viz = DiffusionTrend(th_model, iterations)
trends = model.build_trends(iterations)
viz = DiffusionTrend(th_model, trends)
p5 = viz.plot(width=400, height=400)
vm.add_plot(p5)
Expand Down

0 comments on commit 1bf59de

Please sign in to comment.