def image_fig(data, h, w, x_range, y_range, plot_size):
 fig = figure(x_range=x_range, y_range=y_range, plot_width=plot_size, plot_height=plot_size, toolbar_location=None)
 fig.image_rgba([data], x=[0], y=[0], dw=[w], dh=[h])
 fig.axis.visible = None
 fig.min_border = 0
 return fig

def image_fig ( data , h , w , x_range , y_range , plot_size ) : fig = figure ( x_range = x_range , y_range = y_range , plot_width = plot_size , plot_height = plot_size , toolbar_location = None ) fig . image_rgba ( [ data ] , x = [ 0 ] , y = [ 0 ] , dw = [ w ] , dh = [ h ] ) fig . axis . visible = None fig . min_border = 0 return fig
helper function to generate a figure arguments: data : data to plot h : height w : width x_range : range for x y_range : range for y plot_size : plot size returns: bokeh .