Adding colours to HatchPatternAbbreviation

Is it possible to add different colours when using Hatch Patterns like Horizontal Dash, Dot, Ring, etc? If yes, how?

Hi @Tanuja_Gupta

See the hatch_... properties of models that you want to customize with different colors, patterns, or transparency (alpha). Here’s an example for a vertically defined area VArea.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
"""

from bokeh.plotting import figure, show

p = figure(width=500, height=500)

va = p.varea(x=[0.0,1.0],y1=[-0.5,-0.5],y2=[0.5,0.5],
             fill_color='#ff0000',fill_alpha=0.333,
             hatch_color='#0000ff',hatch_alpha=0.700,
             hatch_pattern='o')

show(p)
1 Like