Bokeh - 楔形和弧形

arc() 方法 根据 x 和 y 坐标、起点和终点角度以及半径绘制一条简单的直线弧。 角度以弧度表示,而半径可以以屏幕单位或数据单位表示。 楔形是一个实心弧。

wedge() 方法 与 arc() 方法具有相同的属性。 这两种方法都提供了可选的方向属性,它可以是顺时针或反时针,它决定了弧形/楔形渲染的方向。 annular_wedge() 函数在内外半径的圆弧之间渲染一个填充区域。


示例

这是添加到 Bokeh 图的 arc 弧形和 wedge 楔形示例 −

from bokeh.plotting import figure, output_file, show
import math
fig = figure(plot_width = 300, plot_height = 300)
fig.arc(x = 3, y = 3, radius = 50, radius_units = 'screen', start_angle = 0.0, end_angle = math.pi/2)
fig.wedge(x = 3, y = 3, radius = 30, radius_units = 'screen',
start_angle = 0, end_angle = math.pi, direction = 'clock')
fig.annular_wedge(x = 3,y = 3, inner_radius = 100, outer_radius = 75,outer_radius_units = 'screen',
inner_radius_units = 'screen',start_angle = 0.4, end_angle = 4.5,color = "green", alpha = 0.6)
show(fig)

输出

wedge glyphs