gpt4 book ai didi

python - 如何在 Matplotlib 中连接图形坐标?

转载 作者:行者123 更新时间:2023-12-01 08:18:58 25 4
gpt4 key购买 nike

enter image description here

我正在用 plt.quiver 绘制输出。所以它给了我一个数组的 2D 字段。但正如我在图像中附加的那样,我想在上边框、下边框以及对象周围连接坐标(看起来像图形下部的圆圈)。

我知道上下边框的 x 和 y 坐标,但我无法将其连接或使其变暗黑色,因此我可以看到非常合适的边界和对象。

matplotlib中有什么简单的函数吗?

plt.quiver(X,Y,U_pretrain,V_pretrain,M_pretrain, cmap=plt.cm.jet, clim=[0.0,1.0])

最佳答案

鉴于您知道上下边框的 x 和 y 坐标,在调用 plt.quiver 后,调用 plt.plot 就足够了

plt.plot(lower_x, lower_y, color='k')
plt.plot(upper_x, upper_y, color='k')

关于python - 如何在 Matplotlib 中连接图形坐标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54804503/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com