Skip to content

[BUG] Using band_hatch_pattern with images doesn't work #11646

Closed

Description

@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.

ALL software version info

bokeh: 2.3.3
panel: 0.12.0
python: 3.8.11
jupyterlab: 3.1.7
OS: Windows 10, version 20H2

Description of expected behavior and the observed behavior & minimal reproducible example

So, this works:

from bokeh.plotting import figure
from bokeh.models import ImageURLTexture
import panel as pn

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)

Output:
image

But this does not:

from bokeh.plotting import figure
from bokeh.models import ImageURLTexture
import panel as pn

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)

Output:
image

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

I'm not sure if I'm using it incorrectly, if band_hatch_patterns just don't support images, or if they're bugged.

Stack traceback and/or browser JavaScript console output

If I serve it as an app, I get no error in the console apart from the missing favicon.

Activity

  1. added this to the 3.0 milestone on Sep 20, 2021
  2. modified the milestones: 3.0, 2.4.1 on Sep 27, 2021
  3. github-actions commented on Oct 26, 2024

    @github-actions

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  4. locked as resolved and limited conversation to collaborators on Oct 26, 2024
  5. added theissue type on Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions