I create a figure in a function, e.g.
import numpy
from bokeh.plotting import figure, show, output_notebook
output_notebook()
def make_fig():
rows = col
Maybe a naive solution, but why not passing the lim axis as argument of your function?
import numpy
from bokeh.plotting import figure, show, output_notebook
output_notebook()
def make_fig(rows=16, cols=16,x_range=[0, 16], y_range=[0, 16], plot_width=500, plot_height=500):
img = numpy.ones((rows, cols), dtype=numpy.uint32)
view = img.view(dtype=numpy.uint8).reshape((rows, cols, 4))
view[:, :, 0] = numpy.arange(256)
view[:, :, 1] = 265 - numpy.arange(256)
fig = figure(x_range=x_range, y_range=y_range, plot_width=plot_width, plot_height=plot_height)
fig.image_rgba(image=[img], x=[0], y=[0], dw=[cols], dh=[rows])
return fig