Bokeh: Hover over image is showing wrong @image tooltip on flipped axis

Created on 22 Mar 2019  路  4Comments  路  Source: bokeh/bokeh

This is continuation of this:
https://github.com/bokeh/bokeh/pull/8031#issuecomment-475488255
I second the comment above.

from matplotlib import pyplot as plt
from skimage.data import astronaut
c = astronaut().mean(axis=-1)[::2,:]
plt.imshow(c)
plt.show()

Gives me this
Screen Shot 2019-03-21 at 10 52 08 PM

While this bokeh (1.0.4) code

scale = 1.0
p = figure(x_range=(1, c.shape[1]), y_range=(c.shape[0],1),
           plot_width=int(c.shape[1]*scale), plot_height=int(c.shape[0]*scale),
           tooltips=[("x", "$x"), ("y", "$y"), ("value", "@image")],
           tools=["hover"])
print(c[89:91,399:401])
p.image(image=[np.flipud(c)],
        x=1, y=c.shape[0],
        dw=c.shape[1], dh=c.shape[0])
show(p)

gives me this
Screen Shot 2019-03-21 at 10 59 39 PM

As you can see - image value is not correct - it seems to be reading it from different region of the image.
Hope this reproducer is clear enough to help dig into it.
Please note that it crucially important to keep Y axis increasing from top to bottom.

completed tag bokehjs bug

Most helpful comment

I'll try to take a look tonight.

All 4 comments

I am using bokeh 1.2.0, the problem is still there. Any update on this?
Thanks

@rmegret that is not generally a useful question. If there were updates, they would be here.

@philippjfr do you still expect to be able to look at this on this cycle?

I'll try to take a look tonight.

Was this page helpful?
0 / 5 - 0 ratings