python - 在 Matplotlib 绘图外绘制箭头

标签 python matplotlib

我有以下网格图,想画一个箭头(使用 MS 绘图显示为蓝色)。我怎样才能通过 matplotlib 做到这一点?我不知道执行此操作的任何命令。

enter image description here

最佳答案

import matplotlib.pyplot as plt

fg = plt.figure(1);
fg.clf();
ax = fg.add_subplot(1,1,1)
ax.annotate('', xy=(0, -0.1), xycoords='axes fraction', xytext=(1, -0.1), 
            arrowprops=dict(arrowstyle="<->", color='b'))
ax.grid(True)
fg.canvas.draw()

给出 enter image description here

关于python - 在 Matplotlib 绘图外绘制箭头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23922804/

相关文章:

python - 在 python 中写入文件时分割内容错误

python - 如何将具有多个键值的字典数组转换为具有单个键值的字典?

python - 如何在 ipyleaflet 中为 WMS 层设置额外选项?

python - 如何从 3D numpy meshgrid 中提取 2D 平面

matplotlib - 增加matplotlib中hline标记的长度

python - 如何在 matplotlib 中使用交互式事件编辑表格数据

python - 带有 namedtuple() 的内部类

python - 添加新小部件时,滚动区域无法扩展(滚动)

matplotlib - 在将轴保持在pyplot子图中的同时移除框架

Python 从长度变化的数组中刷新 Pyplot 线