我在一个函数中创建了一个图形,例如:
import numpy
from bokeh.plotting import figure, show, output_notebook
output_notebook()
def make_fig():
rows = cols = 16
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=[0, c], y_range=[0, rows])
fig.image_rgba(image=[img], x=[0], y=[0], dw=[cols], dh=[rows])
return fig
后来我想放大这张图:
fig = make_fig()
# <- zoom in on plot, like `set_xlim` from matplotlib
show(fig)
我该如何在bokeh中进行程序化缩放?
fig.x_range = Range1d(x_min, x_max)
。 - tommy.carstensen