Bokeh 楔形和弧线


The arc() 方法 根据 x 和 y 坐标、开始和结束角度以及半径绘制简单的弧线。角度以弧度表示,而半径可以以屏幕单位或数据单位表示。楔形是实心圆弧。

The 楔()方法 与 arc() 方法具有相同的属性。两种方法都提供了可选的方向属性,可以是时钟或反时钟,确定弧形/楔形渲染的方向。 ring_wedge() 函数在内圆弧和外圆弧之间渲染填充区域。

例子


这是一个例子 arc and 楔形字形 添加到Bokeh图中:

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