Home > Backend Development > Python Tutorial > How to install bokeh in python

How to install bokeh in python

(*-*)浩
Release: 2019-07-09 10:31:30
Original
5358 people have browsed it

Bokeh (Bokeh.js) is a Python interactive visualization library that supports modern web browsers and provides perfect display functions. Bokeh's goal is to provide an elegant, concise and novel graphical style using D3.js styles, while providing high-performance interaction capabilities for large data sets. Boken can quickly create interactive drawings, dashboards and data applications.

How to install bokeh in python

Quick installation: (Recommended learning: Python video tutorial)

There are many different installations How to install Bokeh

If you are using Anaconda (recommended), use the following command to install it directly through the bash or windows command line.

conda install bokeh
Copy after login

In this installation method, Anaconda has prepared all the dependencies needed before running Bokeh. This is also the installation method strongly recommended by Bokeh. Regardless of any platform, including windows, it can bring the installation cost close to zero. It will also install some examples in the examples/ directory, a subdirectory of the Anaconda installation directory.

Of course, if you are absolutely confident in solving these dependencies, which include Numpy, pandas and redis, you can also use pip to install

pip install bokeh
Copy after login

Note :If installed through pip, these examples will not be installed, but these examples can be downloaded through git clone (examples/).

Use some data of python basic data type list to draw a line graph, including zoom (zoom), area selection (pan), resize (resize), and save (save) Waiting for tools is a simple and direct way.

Note: It is recommended to use ipython notebook. If you don’t understand it, go and learn about it

from bokeh.plotting import figure, output_file, show
# prepare some data
x = [1, 2, 3, 4, 5]y = [6, 7, 2, 4, 5]

# output to static HTML file
output_file("lines.html", title="line plot example")

# create a new plot with a title and axis labels
p = figure(title="simple line example", x_axis_label='x', y_axis_label='y')

# add a line renderer with legend and line thickness
p.line(x, y, legend="Temp.", line_width=2)

# show the results
show(p)
Copy after login

For more Python related technical articles, please visit Python tutorialcolumn for learning!

The above is the detailed content of How to install bokeh in python. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template