Bokeh is a Python library for interactive data visualization. It allows to create interactive plots for the web. For example, one can zoom in, select some of the data points, etc. These plots can be included in Authorea articles quite easily.
Let us first create a simple plot with Bokeh. The source code (adapted
can be found
that we set the size of the plot with
p.plot_width = 500 and
p.plot_height = 500. This is needed to display the figure properly
The next step is to run the code by typing
python simple-plot.py in
a terminal. This creates an HTML file named
The figure can then be simply included with the following steps:
Step 1. From the folder view (folder icon in top sidebar), navigate to the
figures folder and create a new folder, e.g., called
js , and in it a new file, e.g. called
Step 3. Click on QuickEdit in the top bar, select
layout.md , and add the path to your figure, e.g.
Step 4. Go back to your main view. You’re done! Your viz should now magically appear in the document.