等效的 vmin vmax matplotlib 散景

hig*_*ell 6 python plot matplotlib bokeh

我是散景的新用户。虽然问题很简单,但我还没有找到答案。在bokeh库中,matplolib imshow的vmax和vmax是什么意思?例如,在 Matplolib 中,我将 vmin 和 vmax 与这些值一起使用

im = ax.imshow(image_data, vmin = 0.1, vmax = 0.8, origin = 'lower')
Run Code Online (Sandbox Code Playgroud)

但是,如果我使用散景,我会得到不同的结果,

p1 = figure(title="my_title",x_range=[min_x,image_data.shape[0]],y_range=[min_y, image_data.shape[1]], toolbar_location=None)

p1.image(image=[image_data], x=[min_x],y=[min_y],dw=[image_data.shape[0]],dh=[image_data.shape[1]], palette="Spectral11")
color_bar = ColorBar(color_mapper=color_mapper, ticker=LogTicker(),
                             label_standoff=12, border_line_color=None, location=(0,0))
Run Code Online (Sandbox Code Playgroud)

imshow Vs 散景结果 在此处输入图片说明

我的错误是什么?提前致谢

hig*_*ell 4

使用这段代码,它可以工作:

from bokeh.plotting import figure
from bokeh.models.mappers import LogColorMapper
from bokeh.models import ColorBar, LogTicker

color_mapper = LogColorMapper(palette="Viridis256", low=0.1, high=0.8)

plot = figure(x_range=(0,image_data.shape[0]), y_range=(0,image_data.shape[1]),
              toolbar_location=None)
plot.image(image=[image], color_mapper=color_mapper,
           dh=[image_data.shape[0]], dw=[image_data.shape[1]], x=[0], y=[0])

color_bar = ColorBar(color_mapper=color_mapper, ticker=LogTicker(),
                     label_standoff=12, border_line_color=None, location=(0,0))
plot.add_layout(color_bar, 'right')
Run Code Online (Sandbox Code Playgroud)