Getting anchor argument of image_url() to work


I can’t seem to get the anchor argument to work with image_url(), specifically in combination with the angle argument. This script should rotate the image around the center (anchor) but it still seems to rotate around the upper left corner of the image.

Is there something I’m missing or is anchor not working?

from bokeh.plotting import figure, show, output_file

p = figure(x_range=(-500,500), y_range=(-500,500))

p.image_url( url=[ img ],
         x=0, y=0, w=400, h=400, anchor="center", angle=0.5)

1 Like

@comperem It appears that anchor and angle work independently but have a bug when combined. Please file a Github issue with all of the above information.

Ok, got it.

It seems that a rotation by angle first, followed by position placement to x and y immediately following should provide the proper result.

I’ll try this and also send in an issue.