Skip to content

Commit

Permalink
Experimenting with adding bokeh plots to documentation (#932)
Browse files Browse the repository at this point in the history
* Add bokeh examples in docstring

* Add bokeh gallery below matplotlib gallery

* travis

* add 2nd example

make thumb creation compatible with multiple plots

* install selenium in travis

* install selenium to save bokeh thumbs

* fix

* fix again

* add --sphinx-build to container.sh

* rename matplotlib examples

* merge gallery_generator and bokeh_gallery

* fix example docstrings

* pin pydocstyle <5.0
  • Loading branch information
OriolAbril authored and ahartikainen committed Dec 9, 2019
1 parent 3a73dad commit 78d2aff
Show file tree
Hide file tree
Showing 42 changed files with 241 additions and 160 deletions.
12 changes: 12 additions & 0 deletions arviz/plots/elpdplot.py
Expand Up @@ -83,6 +83,7 @@ def plot_elpd(
Examples
--------
Compare pointwise WAIC for centered and non centered models of the 8school problem
using matplotlib.
.. plot::
:context: close-figs
Expand All @@ -95,6 +96,17 @@ def plot_elpd(
>>> xlabels=True
>>> )
.. bokeh-plot::
:source-position: above
import arviz as az
idata1 = az.load_arviz_data("centered_eight")
idata2 = az.load_arviz_data("non_centered_eight")
az.plot_elpd(
{"centered model": idata1, "non centered model": idata2},
backend="bokeh"
)
"""
valid_ics = ["waic", "loo"]
ic = rcParams["stats.information_criterion"] if ic is None else ic.lower()
Expand Down
1 change: 1 addition & 0 deletions doc/conf.py
Expand Up @@ -52,6 +52,7 @@
"sphinx.ext.viewcode",
"sphinx.ext.githubpages",
"matplotlib.sphinxext.plot_directive",
"bokeh.sphinxext.bokeh_plot",
"numpydoc",
"nbsphinx",
"m2r",
Expand Down
48 changes: 24 additions & 24 deletions doc/index.rst
Expand Up @@ -102,64 +102,64 @@ Here is the citation in BibTeX format
</div>
<div class="col-md-6">
<div class="container-fluid hidden-xs hidden-sm">
<a href="examples/plot_pair.html">
<a href="examples/matplotlib/mpl_plot_pair.html">
<div class="col-md-3 thumbnail">
<img src="_static/plot_pair_thumb.png">
<img src="_static/mpl_plot_pair_thumb.png">
</div>
</a>
<a href="examples/plot_forest.html">
<a href="examples/matplotlib/mpl_plot_forest.html">
<div class="col-md-3 thumbnail">
<img src="_static/plot_forest_thumb.png">
<img src="_static/mpl_plot_forest_thumb.png">
</div>
</a>
<a href="examples/plot_density.html">
<a href="examples/matplotlib/mpl_plot_density.html">
<div class="col-md-3 thumbnail">
<img src="_static/plot_density_thumb.png">
<img src="_static/mpl_plot_density_thumb.png">
</div>
</a>
<a href="examples/plot_energy.html">
<a href="examples/matplotlib/mpl_plot_energy.html">
<div class="col-md-3 thumbnail">
<img src="_static/plot_energy_thumb.png">
<img src="_static/mpl_plot_energy_thumb.png">
</div>
</a>
<a href="examples/plot_posterior.html">
<a href="examples/matplotlib/mpl_plot_posterior.html">
<div class="col-md-3 thumbnail">
<img src="_static/plot_posterior_thumb.png">
<img src="_static/mpl_plot_posterior_thumb.png">
</div>
</a>
<a href="examples/plot_kde_2d.html">
<a href="examples/matplotlib/mpl_plot_kde_2d.html">
<div class="col-md-3 thumbnail">
<img src="_static/plot_kde_2d_thumb.png">
<img src="_static/mpl_plot_kde_2d_thumb.png">
</div>
</a>
<a href="examples/plot_forest_ridge.html">
<a href="examples/matplotlib/mpl_plot_forest_ridge.html">
<div class="col-md-3 thumbnail">
<img src="_static/plot_forest_ridge_thumb.png">
<img src="_static/mpl_plot_forest_ridge_thumb.png">
</div>
</a>
<a href="examples/plot_parallel.html">
<a href="examples/matplotlib/mpl_plot_parallel.html">
<div class="col-md-3 thumbnail">
<img src="_static/plot_parallel_thumb.png">
<img src="_static/mpl_plot_parallel_thumb.png">
</div>
</a>
<a href="examples/plot_trace.html">
<a href="examples/matplotlib/mpl_plot_trace.html">
<div class="col-md-3 thumbnail">
<img src="_static/plot_trace_thumb.png">
<img src="_static/mpl_plot_trace_thumb.png">
</div>
</a>
<a href="examples/plot_joint.html">
<a href="examples/matplotlib/mpl_plot_joint.html">
<div class="col-md-3 thumbnail">
<img src="_static/plot_joint_thumb.png">
<img src="_static/mpl_plot_joint_thumb.png">
</div>
</a>
<a href="examples/plot_ppc.html">
<a href="examples/matplotlib/mpl_plot_ppc.html">
<div class="col-md-3 thumbnail">
<img src="_static/plot_ppc_thumb.png">
<img src="_static/mpl_plot_ppc_thumb.png">
</div>
</a>
<a href="examples/plot_autocorr.html">
<a href="examples/matplotlib/mpl_plot_autocorr.html">
<div class="col-md-3 thumbnail">
<img src="_static/plot_autocorr_thumb.png">
<img src="_static/mpl_plot_autocorr_thumb.png">
</div>
</a>
</div>
Expand Down

0 comments on commit 78d2aff

Please sign in to comment.