Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Material-Scientist opened this issue Sep 20, 2021 · 0 comments · Fixed by #11650
Closed

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

Material-Scientist opened this issue Sep 20, 2021 · 0 comments · Fixed by #11650

Comments

@Material-Scientist
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants