☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Using band_hatch_pattern with images

Community Supportbokeh
Material-Scientist
Material-Scientist

Hi,
I’m trying to use hatch_patterns as watermarks. It works for i.e. vbars, but it might be better if it were used in a band_hatch.

So, this works:

from bokeh.io import output_file, show
from bokeh.plotting import figure
from bokeh.models import ImageURLTexture
import panel as pn
import holoviews as hv
import numpy as np

hv.extension('bokeh')

pn.extension()

p = figure(height=250, width=600)
p.vbar(x=[0],
       top=[1],
       alpha=0.2,
       hatch_extra={ 'mycustom': ImageURLTexture(url='https://miro.medium.com/fit/c/262/262/2*hYgXkcU-IzRzAGrw4kN5lQ.png') },
       hatch_pattern = dict(value="mycustom"),hatch_scale=12
      )

pn.Column(p)

image

But this does not:

from bokeh.io import output_file, show
from bokeh.plotting import figure
from bokeh.models import ImageURLTexture
import panel as pn
import holoviews as hv
import numpy as np

hv.extension('bokeh')

pn.extension()

p = figure(height=250, width=600)
p.vbar(x=[0],
       top=[1],
       alpha=0.2,
#        hatch_extra={ 'mycustom': ImageURLTexture(url='https://miro.medium.com/fit/c/262/262/2*hYgXkcU-IzRzAGrw4kN5lQ.png') },
#        hatch_pattern = dict(value="mycustom"),hatch_scale=12
      )

p.xgrid.band_hatch_extra={ 'mycustom': ImageURLTexture(url='https://miro.medium.com/fit/c/262/262/2*hYgXkcU-IzRzAGrw4kN5lQ.png') }
p.xgrid.band_hatch_pattern = 'mycustom'

pn.Column(p)

image

Using '/' as hatch_pattern, you get this:
image

Am I doing it wrong or do band_hatch_patterns just not support images?

⌁   Link to post
Bryan
Bryan

I don’t know that this specific combination of usage has ever been explicitly considered. Are there any errors reported in the browser’s JavaScript console?

Edit: also please always include version information in all support questions, so that others can actually try your code in the same context.

⌁   Link to post
Material-Scientist
Material-Scientist

OK - I was just unsure if this was really a bug or if I didn’t use it properly.

Bug report:

⌁   Link to post

End of archived discussion · Replies are disabled