Learn Before
Concept

Plotting with Bokeh

The Python interactive visualization library Bokeh enables high-performance visual presentation of large datasets in modern web browsers.

Bokeh’s mid-level general purpose bokeh.plotting interface is centered around two main components: data and glyphs.

The basic steps to creating plots with the bokeh.plotting interface are:

  1. Prepare some data:

Python lists, NumPy arrays, Pandas DataFrames and other sequences of values

  1. Create a new plot

  2. Add renderers for your data, with visual customizations

  3. Specify where to generate the output

  4. Show or save the results

from bokeh.plotting import figure from bokeh.io import output_file, show x = [1, 2, 3, 4, 5] y = [6, 7, 2, 4, 5] p = figure(title="simple line example", p.line(x, y, legend="Temp.", line_width=2) x_axis_label='x', y_axis_label='y') output_file("lines.html") show(p)
Image 0

0

1

Updated 2021-07-06

Tags

Python Programming Language

Data Science

Related