Bokeh - 样式视觉属性



Bokeh 绘图的默认外观可以通过将各种属性设置为所需的值来自定义。这些属性主要分为三种类型:

线条属性

下表列出了与线条 Glyph 相关的各种属性。

1 line_color 用于绘制线条的颜色
2 line_width 以像素为单位的线宽
3 line_alpha 0(透明)到 1(不透明)之间的浮点数
4 line_join 如何连接路径段。定义的值为:'miter' (miter_join), 'round' (round_join), 'bevel' (bevel_join)
5 line_cap 如何终止路径段。定义的值为:'butt' (butt_cap), 'round' (round_cap), 'square' (square_cap)
6 line_dash 线条样式。定义的值为:'solid','dashed','dotted','dotdash','dashdot'
7 line_dash_offset 图案应从中开始的 line_dash 中的距离(以像素为单位)

填充属性

以下是各种填充属性:

1 fill_color 用于填充路径的颜色
2 fill_alpha 0(透明)到 1(不透明)之间的浮点数

Explore our latest online courses and learn new skills at your own pace. Enroll and become a certified expert to boost your career.

文本属性

下表列出了许多与文本相关的属性:

1 text_font 字体名称,例如 'times'、'helvetica'
2 text_font_size 字体大小,例如 '12pt'、'1.5em'
3 text_font_style 要使用的字体样式 'normal' 'italic' 'bold'
4 text_color 用于呈现文本的颜色
5 text_alpha 0(透明)到 1(不透明)之间的浮点数
6 text_align 文本的水平锚点 - 'left'、'right'、'center'
7 text_baseline 文本的垂直锚点 'top'、'middle'、'bottom'、'alphabetic'、'hanging'
广告