如何使用python bokeh库创建比例(预定义边界)颜色条

问题描述 投票:0回答:1

[我想绘制一个与图1一样在右侧具有比例颜色条的图,但使用bokeh而非matplotlib:]

matplotlib版本为: proportional (pre-define boundaries) colour bar using matplotlib colors.BoundaryNorm(bounds, cmap.N)

但是我当前的bokeh版本看起来像这样:right hand side colour bar not proportional, although I have given ticker boundaries

请参阅我的bokeh版本代码。尽管我已经给出了股票行情界限,但是颜色条仍然不成比例。

ticker = FixedTicker(ticks=bounds)
bounds = [0, 5, 25, 75, 95,100]
color_bar = ColorBar(color_mapper=mapper, major_label_text_font_size='5pt',
                         ticker=ticker,
                         formatter=PrintfTickFormatter(format='%d%%'),
                         label_standoff=6, border_line_color=None, location=(0, 0))

之所以使用bokeh是因为我想将其与Django一起使用,并在bokeh库中具有tools选项。

请提出建议。预先感谢,

[我想在图的右侧绘制一个带有比例色条的图,但是使用散景而不是matplotlib:matplotlib的版本是:比例(预定义边界)颜色...

python django colors bokeh bounds
1个回答
0
投票

我从discourse.bokeh.org社区支持中得到了答案。有一种方法,但是构建新功能会更好。答案是here

© www.soinside.com 2019 - 2024. All rights reserved.