📜  Python中的 bokeh.plotting.figure.diamond_cross()函数

📅  最后修改于: 2022-05-13 01:54:50.546000             🧑  作者: Mango

Python中的 bokeh.plotting.figure.diamond_cross()函数

散景 是Python中的数据可视化库,提供高性能的交互式图表和绘图,输出可以在笔记本、HTML 和服务器等各种媒体中获得。 Figure 类创建一个新的 Figure 用于绘图。它是 Plot 的子类,使用默认轴、网格、工具等简化绘图创建。

bokeh.plotting.figure.diamond_cross()函数

bokeh 库的绘图模块中的diamond_cross()函数用于配置和添加 DiamondCross 字形到此图。

下面的示例说明了 bokeh.plotting 中的 bokeh.plotting.figure.diamond_cross()函数:
示例 1:

Python3
# Implementation of bokeh function 
     
import numpy as np  
from bokeh.plotting import figure, output_file, show 
     
plot = figure(plot_width = 300, plot_height = 300) 
plot.diamond_cross(x = [1, 2, 3], y = [3, 7, 5],  
            size = 20, fill_color = None,
            line_color = "green", alpha = 0.9) 
     
show(plot)


Python3
# Implementation of bokeh function 
     
import numpy as np  
from bokeh.plotting import figure, output_file, show 
     
x = [1, 2, 3, 4, 5] 
y = [6, 7, 8, 7, 3] 
    
output_file("geeksforgeeks.html") 
    
p = figure(plot_width = 300, plot_height = 300) 
  
p.line(x, y, line_width = 2) 
p.diamond_cross(x, y, fill_color ="red",  
         line_color ="green", size = 18) 
    
show(p)


输出:

示例 2:

Python3

# Implementation of bokeh function 
     
import numpy as np  
from bokeh.plotting import figure, output_file, show 
     
x = [1, 2, 3, 4, 5] 
y = [6, 7, 8, 7, 3] 
    
output_file("geeksforgeeks.html") 
    
p = figure(plot_width = 300, plot_height = 300) 
  
p.line(x, y, line_width = 2) 
p.diamond_cross(x, y, fill_color ="red",  
         line_color ="green", size = 18) 
    
show(p) 

输出: