Bokeh 简明教程

Bokeh - Wedges and Arcs

arc() method 基于 x 和 y 坐标、起始和结束角度以及半径绘制一个简单的线弧。角度以弧度给出,而半径可能以屏幕单位或数据单位给出。扇形是一个填充的圆弧。

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

Example

以下是添加到 Bokeh 图形中的 arcwedge glyphs 的示例 −

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)

Output

wedge glyphs