如何使用 Bokeh(Python)处理图像?
要使用 Bokeh 处理图像,请使用 image_url() 方法并传递图像列表。
步骤
- 配置默认输出状态以便当调用**:func: 'show'** 时生成保存至文件中的输出。
- 创建一个新的图片用于绘制。
- 呈现从给定 URL 加载的图像。
- 立即显示 Bokeh 对象或应用程序。
示例
from bokeh.plotting import figure, show, output_file
output_file('image.html')
p = figure(x_range=(0, 1), y_range=(0, 1))
p.image_url(url=['bird.jpg'], x=0, y=1, w=0.8, h=0.6)
show(p)输出
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP