相关疑难解决方法(0)

在绘制的线上打印字符串(模拟等高线图标签)

等高线图演示展示了如何绘制与绘制在他们的电平值的曲线,见下文.

在此输入图像描述

对于像下面的代码获得的简单线条图,有没有办法做同样的事情?

import matplotlib.pyplot as plt 

x = [1.81,1.715,1.78,1.613,1.629,1.714,1.62,1.738,1.495,1.669,1.57,1.877,1.385]
y = [0.924,0.915,0.914,0.91,0.909,0.905,0.905,0.893,0.886,0.881,0.873,0.873,0.844]

# This is the string that should show somewhere over the plotted line.
line_string = 'name of line'

# plotting
plt.plot(x,y)
plt.show()
Run Code Online (Sandbox Code Playgroud)

python matplotlib

13
推荐指数
2
解决办法
3546
查看次数

标签 统计

matplotlib ×1

python ×1