Bokeh can be easily used in conjunction with NumPy, Pandas, and other Python packages. It can be used to produce interactive plots, dashboards, and so on.
Dependencies of Bokeh −
Numpy Pillow Jinja2 Packaging Pyyaml Six Tornado Python−dateutil
Installation of Bokeh on Windows command prompt
pip3 install bokeh
Installation of Bokeh on Anaconda prompt
conda install bokeh
The ‘step’ function present in glyph function is used to generate discrete data points.
from bokeh.plotting import figure, output_file, show output_file("stepLine.html") p = figure(plot_width=500, plot_height=300) p.step([2, 5, 3, 6, 7,9], [6,3, 2, 1, 0, 5], line_width=2, mode="center") show(p)
The required packages are imported, and aliased.
The figure function is called along with plot width and height.
The ‘output_file’ function is called to mention the name of the html file that will be generated.
The ‘step’ function present in Bokeh is called, along with data.
It helps render the steps.
The ‘show’ function is used to display the plot.