Hex_tile dynamically change `size`

i know how to use a ColumnDataSource to change q and r of hex_tile, but i’d like to change size as well. is it possible?

so specifically, consider this example, which i copy here and modify to use a ColumnDataSource:

import numpy as np

from bokeh.io import output_file, show
from bokeh.plotting import figure
from bokeh.transform import linear_cmap
from bokeh.util.hex import hexbin

n = 50000
x = np.random.standard_normal(n)
y = np.random.standard_normal(n)

bins = hexbin(x, y, 0.1)
cds = ColumnDataSource(bins)

p = figure(title="Manual hex bin for 50000 points", tools="wheel_zoom,pan,reset",
           match_aspect=True, background_fill_color='#440154')
p.grid.visible = False

p.hex_tile(q="q", r="r", size=0.1, line_color=None, source=cds,
           fill_color=linear_cmap('counts', 'Viridis256', 0, max(bins.counts)))

output_file("hex_tile.html")

show(p)

how do i subsequently change hex_tile's size to match a new hexbin() with a different size argument:

bins2 = hexbin(x, y, 0.2)   ### same data (x,y), but new size=0.2
cds.data.update(q=bins2['q'], r=bins2['r'], counts=bins2['counts'], index=range(len(bins2['counts'])))

the plot is updated, but the axes are scaled by 2. but since it’s the same data, i want the axes to be the same. possible? thanks.

Could you just explicitly set p.x_range and p.y_range?

It’s a little unclear to me what the actual ask/need is but in case it is to change the glyph’s size:

renderer = p.hex_tile(...)

renderer.glyph.size = 0.2

However I would expect that doubling size would make the plotted data take up more space, so I am not sure what “I want the axes to be the same” means in this context.

thanks!! i should’ve remember the glyph trick.