RSS graph - 1/1 Blog automation (4) documentation (8) example (2) latex (2) notebook (4) sphinx (10)


graph - 1/1

Insert plot from bokeh in the documentation

2015-04-12

As graphs from matplotlib, graphs from bokeh can be inserted in the documentation with the extension bokeh.sphinxext.bokeh_plot.

I replicate here the example from the documentation:

.. bokeh-plot::

    from bokeh.plotting import figure, output_file, show

    output_file("example_bokeh.html")

    x = [1, 2, 3, 4, 5]
    y = [6, 7, 6, 4, 5]

    p = figure(title="example_bokeh", plot_width=300, plot_height=300)
    p.line(x, y, line_width=2)
    p.circle(x, y, size=10, fill_color="white")

    show(p)

See example with bokeh to se the result. Including this code in the blog post fails but it should be fixed some days.

Last detail, for some reasons I don’t know, the instruction output_file must remain. I tried different version with different title and file name but it did not work either. You should look into bokeh’s documentation to get a better sense of how it works as this macro is used to generate the documentation of the module.

post


RSS graph - 1/1 2015-04 (8) 2015-05 (4) 2015-08 (2) 2015-10 (1) 2015-12 (3) 2016-01 (1) 2016-02 (3) 2016-04 (1) 2016-06 (1)