I am trying to use ImageURL to put a watermark on a plot, but since ImageURL does not support x_units or y_units it is not possible to set these to “screen” and have plot image stationary to the figure when panning and zooming. I have successfully used Label to put a text string on the plot with x_units=“screen” and would like to do the same with ImageURL.
I am uncertain if I am missing something or this would qualify as a feature request.
A minimal working example would be:
from bokeh.models.glyphs import ImageURL
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure, show
import numpy as np
logo_source = ColumnDataSource(dict(url=[“http://bokeh.pydata.org/en/latest/_static/images/logo.png”]))
x = np.random.normal(loc=5000.0, size=400)
y = np.random.normal(loc=5000.0, size=400)
logo_image = ImageURL(url=“url”, x=5000, y=5000, w=50, h=50, w_units=‘screen’, h_units=‘screen’, global_alpha=0.2, )
This does not work. Not possible to set x_units=‘screen’
#logo_image = ImageURL(url=“url”, x=5000, y=5000, w=50, h=50, w_units=‘screen’, h_units=‘screen’, global_alpha=0.2, x_units=‘screen’, y_units=‘screen’ )
p = figure(plot_width=600, plot_height=600)