bokeh 个人学习笔记

                                              bokeh学习笔记

用 bokeh.plotting接口创建图表的基本步骤如下:

  • 准备一些数据(在上面的例子中,数据是一个简单的Python列表)
  • 指定一个输出(在上面的例子中,用output_file()函数指定了输出文件名为"lines.html"
  • 调用figure()函数创建图表容器并指定一些整体参数,比如title、tools和axes labels
  • 将数据传入渲染函数(在上面的例子中是Figure.line函数)并指定一些视觉参数,比如colors、legends和widths
  • 调用show()或者save()来显示或保存结果

步骤三、四可以重复使用来绘制多个图形。

 

  1. 在使用figure函数创建图表容器时,可以执行的操作:
  • 为这个图标命名
  • 为坐标轴命名
  • 为坐标轴指定范围
  • 为坐标轴指定类型
  • tools
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'
)

     2.p.line() 指定视觉参数

  • x与y相对应的值
  • line 颜色
  • line 形式(有circle、虚线等(可设置参数))
  • legend
p.line(x, x, legend="y=x")
p.circle(x, x, legend="y=x", fill_color="white", size=8)
p.line(x, y0, legend="y=x^2", line_width=3)
p.line(x, y1, legend="y=10^x", line_color="red")
p.circle(x, y1, legend="y=10^x", fill_color="red", line_color="red", size=6)
p.line(x, y2, legend="y=10^x^2", line_color="orange", line_dash="4 4")

more examples:

时间序列图形-Datetime axes

Bokeh图形服务器-Bokeh Plot Server

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Learn how to create interactive and visually aesthetic plots using the Bokeh package in Python Key Features A step by step approach to creating interactive plots with Bokeh Go from nstallation all the way to deploying your very own Bokeh application Work with a real time datasets to practice and create your very own plots and applications Book Description Adding a layer of interactivity to your plots and converting these plots into applications hold immense value in the field of data science. The standard approach to adding interactivity would be to use paid software such as Tableau, but the Bokeh package in Python offers users a way to create both interactive and visually aesthetic plots for free. This book gets you up to speed with Bokeh - a popular Python library for interactive data visualization. The book starts out by helping you understand how Bokeh works internally and how you can set up and install the package in your local machine. You then use a real world data set which uses stock data from Kaggle to create interactive and visually stunning plots. You will also learn how to leverage Bokeh using some advanced concepts such as plotting with spatial and geo data. Finally you will use all the concepts that you have learned in the previous chapters to create your very own Bokeh application from scratch. By the end of the book you will be able to create your very own Bokeh application. You will have gone through a step by step process that starts with understanding what Bokeh actually is and ends with building your very own Bokeh application filled with interactive and visually aesthetic plots. What you will learn Installing Bokeh and understanding its key concepts Creating plots using glyphs, the fundamental building blocks of Bokeh Creating plots using different data structures like NumPy and Pandas Using layouts and widgets to visually enhance your plots and add a layer of interactivity Building and hosting applications on the Bokeh server Creating advanced plots using spatial data Who this book is for This book is well suited for data scientists and data analysts who want to perform interactive data visualization on their web browsers using Bokeh. Some exposure to Python programming will be helpful, but prior experience with Bokeh is not required. Table of Contents Bokeh installation and key concepts Plotting using glyphs Plotting with different data structures Using layouts for effective presentation Using annotations, widgets and visual attributes for visual enhancement Building and hosting applications using the Bokeh Server Advanced Plotting with Networks, Geo data, WebGL and Exporting plots The Bokeh Workflow: A case study

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值