Home > Article > Backend Development > How to install bokeh in python
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.
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
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
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)
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!