这段代码在使用
Bokeh的发布说明没有提到对
bokeh==2.1.1
时呈现出一张图像(虽然是倒置的):from PIL import Image
import numpy as np
import requests
from bokeh.plotting import figure
from bokeh.io import output_notebook
from bokeh.plotting import show
output_notebook()
response = requests.get('https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg', stream=True)
rgba_img = Image.open(response.raw).convert("RGBA")
numpy_img = np.array(rgba_img)
fig = figure()
plotted_image = fig.image_rgba(image=[np_img], x=50, y=50, dw=50, dh=50)
show(fig)
在bokeh==2.2.0
(以及后续版本)中运行完全相同的代码不会输出任何内容,也不会引发任何错误。Bokeh的发布说明没有提到对
image_rgba()
的任何更改。