Advertisement

Python中使用matplotlib进行曲线部分填充fill_betweenx

阅读量:

在 Python 编程语言中,可通过 matplotlib 库实现对曲线下方区域的填充操作,具体功能为 fill_betweenx。其展示的视觉效果如下:

复制代码
 def Plot_LSH_Curve(b, r, Sim_T):

    
     s = np.arange(0, 1, 0.01)
    
     p = 1 - np.power(1 - np.power(s, r), b)
    
  
    
     fig = plt.figure()
    
     ax = plt.gca()
    
     # ax = fig.add_subplot(111)
    
     ax.plot(s, p, color='red', linewidth=2)
    
     plt.vlines(Sim_T, [0], 1, color="green", linewidth=3, linestyles="dashed")
    
     ax.fill_betweenx(p, Sim_T, s, facecolor="orange", colo

全部评论 (0)

还没有任何评论哟~