📜  Bokeh-楔形和弧形

📅  最后修改于: 2020-11-09 05:11:25             🧑  作者: Mango


arc()方法根据x和y坐标,起始和终止角度以及半径绘制一条简单的圆弧。角度以弧度为单位,而半径可以以屏幕为单位或以数据为单位。楔形是实心圆弧。

楔子()方法与弧()方法具有相同的属性。两种方法都提供了可选的direction属性,可以是确定弧/楔渲染方向的时钟或反时钟。 radius_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)

输出

楔形字形