holoviz / holoviz/datashader

create_ramp_legend does not include the color for the highest density

Open
#277 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
3.6k
Forks
376
Avg merge
4h 32m
Merged PRs (30d)
1

Description

This may be related to issue #276. In testing different palettes in the [legend example notebook](https://github.com/bokeh/datashader/blob/master/examples/legends.ipynb), it seems the legend never includes the highest concentration of data points.

I tried a palette with only two colors, `palette = ['white', 'navy']`, made a few changes in the `create_base_plot` definition
```
# img = tf.shade(agg, cmap=Hot, how='log')
img = tf.shade(agg, cmap=palette, how='eq_hist')
...
fig.background_fill_color = 'white' # 'black'
```
then got the following result.
![image](https://cloud.githubusercontent.com/assets/9484229/22523049/f8fd6056-e88b-11e6-802f-bce3422523d5.png)
There is an obvious difference between the legend and figure and the legend. It is surprising that navy is not included in any of the legends, `'eq_hist'`, `'log'`, or `'linear'`; actually these three different legends exhibit only minor differences.

Repeating this with the viridis 256 colormap, `from bokeh.palettes import Viridis256 as palette`, gives a similarly surprising result, with no yellow in any of the legends.
![image](https://cloud.githubusercontent.com/assets/9484229/22523254/b20dd36e-e88c-11e6-91c9-bc3eeb36d3c7.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.