关于python:如何绘制曲线可能重叠的图?

how to make plot where curves may overlap?

我正在尝试绘制与此类似的情节

enter


只需使用annotate,这应该可以使您达到90%:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
x = np.linspace(0,1000)
y = x ** -2

figure()
ax = gca()
ax.loglog(x,y)
ax.grid(True)
ax.grid(True, which='minor')

ax.annotate('a1', (x[15], y[15]),
            backgroundcolor='w',
            color='b',
            va='center',
            ha='center',
            bbox=dict(boxstyle="round", color='b'),)

annotate文档和示例。获得圈子可能很棘手。如果您真的想使用圈子,我建议您在github上提交功能请求。 (似乎花了几个小时来研究mpl胆量以添加椭圆形边界框)。