如何在 Bokeh (Python) 中处理图像?
matplotlibpythondata visualization更新于 2025/6/3 5:00:17
要在 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)
输出
相关文章
有用资源
python 参考教程 - 该教程包含有关 python 的更多信息:https://www.cainiaomax.com/python/

