跳转到主要内容

使用matplotlib轻松绘制漂亮的箭头

项目描述

License PyPI Python Version CI codecov Documentation Status

mpl-arrow

在matplotlib中绘制漂亮箭头的一种更简单的方法

安装

pip安装mpl-arrow

示例用法

import matplotlib.pyplot as plt

from mpl_arrow import arrow, arrow_absolute, vector

fig, ax = plt.subplots()

#     x, y, dx, dy
arrow(1, 0, 2, 0.5, label="arrow")

#              x,  y,  x2,  y2
arrow_absolute(1, 0.5, 3.5, 2, label="arrow absolute")

#     dx, dy
vector(4, 4, label="vector")

#     dx, dy, x,    y
vector(4, 4, x=0, y=2, label="vector with offset")

plt.legend()
plt.show()

arrows

支持者