Hello.
I’m having strange issue trying to create a legend for a heatmap.
I was using https://bokeh.pydata.org/en/latest/docs/gallery/unemployment.html as an template/example. Heatmap works fine, but ticks for ColorBar I’m using as a legend are not behaving.
Code:
p = figure(x_axis_type=“datetime”, x_range=(0, 10), y_range=[0, 10],
tools=‘hover, box_zoom, reset, save’, width=600, height=600, title=‘Title’)
mapper = LinearColorMapper(palette=RdYlGn10, low=0, high=300)
color_bar = ColorBar(color_mapper=mapper, location=(0, 0),
ticker=BasicTicker(desired_num_ticks=len(RdYlGn10), num_minor_ticks=0),
formatter=NumeralTickFormatter(format=“0,0”))
p.add_layout(color_bar, ‘right’)output_notebook() show(p)
Expected results: color bar with 10 cells (from palette RdYlGn10) and 10 ticks, one for each cell.
Actual results: 7 ticks on ticker. And if I change ‘high’ value for LinearColorMapper to let’s say 200, I’m getting 11 ticks. For 150 - 7 ticks. Looks like ‘desired_num_ticks’ parameter being completely ignored.
Question: is that a defect?
Thanks!

