<jupyter_start><jupyter_text>Bokeh[Bokeh](https://github.com/bokeh/bokeh) 是一个浏览器端的交互可视化库。它提供了丰富的图形库和应付大数据的高性能，能帮助大家快速简洁地构建交互式图形和数据应用。也是所有python可视化库里使用最多的（多过matplotlib，在awesome-python列出的可视化库里，它的star是最多的。 安装安装很简单：```Shellconda install -c conda-forge bokeh``` 快速开始直接先看一个例子，绘制折线图：<jupyter_code>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")

# 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_label="Temp.", line_width=2)

# show the results
show(p)<jupyter_output><empty_output><jupyter_text>运行之后，会看到文件夹下游一个名为"lines.html"的文件，并且浏览器会自动打开其展示。使用 bokeh.plotting 接口创建图形的基本步骤是：- 准备数据- 告诉Bokeh输出到哪- 调用figure()- 增加renders- show()或者save()结果<jupyter_code>from bokeh.plotting import figure, output_file, show

# prepare some data
x = [0.1, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0]
y0 = [i**2 for i in x]
y1 = [10**i for i in x]
y2 = [10**(i**2) for i in x]

# output to static HTML file
output_file("log_lines.html")

# create a new plot
p = figure(
   tools="pan,box_zoom,reset,save",
   y_axis_type="log", y_range=[0.001, 10**11], title="log axis example",
   x_axis_label='sections', y_axis_label='particles'
)

# add some renderers
p.line(x, x, legend_label="y=x")
p.circle(x, x, legend_label="y=x", fill_color="white", size=8)
p.line(x, y0, legend_label="y=x^2", line_width=3)
p.line(x, y1, legend_label="y=10^x", line_color="red")
p.circle(x, y1, legend_label="y=10^x", fill_color="red", line_color="red", size=6)
p.line(x, y2, legend_label="y=10^x^2", line_color="orange", line_dash="4 4")

# show the results
show(p)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1623123957754308, 'fraction_numerical': 0.032795997776542525, 'mean_word_length': 6.594936708860759, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '638533', 'license': 'MIT', 'n_tokens_mistral': 886, 'n_tokens_neox': 898, 'n_words': 164, 'path': '3-interactive-pyviz/1-bokeh-intro.ipynb', 'repo_name': 'OuyangWenyu/hydrus', 'size': '1799'}