在下面的代码中,我使用axhline命令沿x轴绘制一条水平线。现在我想在两条线已经相交的地方画一条垂直线。我不能用axvline,因为我不知道交集的值。以阿克斯林为例,我用50%的概率值来画这条线。在
x=[1, 1.5, 2, 5, 5.5, 6 ]
y=[1, 1, 0.89189189, 0.01086957, 0.01190476, 0]
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(x,y,marker='o')
plt.axhline(0.5, color='r')
Tags:
这里有一种方法,求出连接第三点和第四点的直线方程。这不是一个通用的解决方案,而是为您的特定问题和数据集量身定做的。在
输出
相关问题 更多 >
编程相关推荐