alex_bn_lee

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

【543】pyplot 制图相关

参考:

参考:


 

参考示例

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import matplotlib.pyplot as plt
import numpy as np
 
fig = plt.figure()
ax = fig.add_subplot(111)
 
plt.plot(np.array(range(len(areas)))/len(areas),
            np.array(areas)/max(areas), linewidth=2,
        label='Area'
 
x = np.arange(0, 1.1, 0.1)
y1 = 1 - x
y2 = 1 - threshold - x
 
plt.plot(x, y1, color='black', dashes=[8, 4], linewidth=0.5,
        label='y=1-x')
plt.plot(x, y2, color='red', dashes=[8, 4], linewidth=0.5,
        label='y=(1-th)-x'
 
plt.xlim(0,1.1)
plt.ylim(0,1.1)
 
plt.xlabel('Normalized area')
plt.ylabel('Normalized step')
 
x0, y0 = 0.14814814814814814, 0.18350667259595277
x01, y01 = 0, 1
x02, y02 = 1, 0
plt.plot(x0, y0, 'om', color='black')
plt.plot(x01, y01, 'om', color='black')
plt.plot(x02, y02, 'om', color='black')
plt.annotate('Pcut1', xy=(x0, y0), xytext=(x0+0.02, y0+0.02))
plt.annotate('P0', xy=(x01, y01), xytext=(x01+0.02, y01+0.02))
plt.annotate('Pn', xy=(x02, y02), xytext=(x02+0.02, y02+0.02))
 
ax.set_aspect('equal', adjustable='box')
 
plt.legend()
plt.show()

 

posted on   McDelfino  阅读(54)  评论(0编辑  收藏  举报

编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2018-04-04 【306】通过ArcPy编写ArcToolbox
2012-04-04 【028】◀▶ 自定义命令 & 工具
点击右上角即可分享
微信分享提示