I am interested in using Bokeh to place images inside IPython laptops. In particular, the data type with which I often interact is a multidimensional NumPy array with 3 or more dimensions. Take an example of a three-dimensional array. A common example is RGB images. Three dimensions: x , y and color
I am interested in using Bokeh to build a single image channel in an IPython laptop. I would like to provide an interactive slider that allows an IPython laptop user to click on each 3rd dimension index, in this example, color.
My code below (when running on an IPython laptop) successfully shows the graph of the first color channel. But I canβt understand what causes the error when I call interact . Have I correctly defined my ColumnDataSource correctly and correctly pointed to the construction of the Bokeh section?
# imports import numpy as np from scipy.misc import imread from bokeh.plotting import figure, show from bokeh.io import output_notebook from bokeh.models import ColumnDataSource from bokeh.palettes import Greys9 from IPython.html.widgets import interact
# enable Bokeh to plot to the notebook output_notebook()
# try to add interactive slider
Javascript error:
Javascript error adding output! TypeError: Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The provided float value is non-finite. See your browser Javascript console for more details.
I'm not sure how this can be. I tried to force RGB_Image for the float by doing RGB_Image = RGB_Image.astype(float) right after defining it, but got the same error.
source share