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(不透明)之間的浮點數

文字屬性

下表列出了許多與文字相關的屬性:

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'
廣告