📜  Python中的 Matplotlib.axes.Axes.arrow()

📅  最后修改于: 2022-05-13 01:55:25.511000             🧑  作者: Mango

Python中的 Matplotlib.axes.Axes.arrow()

Matplotlib是Python中的一个库,它是 NumPy 库的数值数学扩展。 Axes 类包含大部分图形元素:Axis、Tick、Line2D、Text、Polygon 等,并设置坐标系。 Axes 的实例通过回调属性支持回调。

matplotlib.axes.Axes.arrow()函数

matplotlib 库的 axes 模块中的Axes.arrow()函数也用于向轴添加箭头。该函数用于绘制从 (x, y) 到 (x+dx, y+dy) 的箭头

下面的示例说明了 matplotlib.axes 中的 matplotlib.axes.Axes.arrow()函数:

示例 1:

Axes.arrow(self, x, y, dx, dy, **kwargs)

输出:

示例 2:

# Implementation of matplotlib function
import matplotlib.pyplot as plt
  
ax = plt.axes()
ax.arrow(0, 0, 0.6, 0.7, head_width = 0.05, 
         head_length = 0.1)
  
ax.set_title('matplotlib.axes.Axes.arrow() Example', 
             fontsize = 14, fontweight ='bold')
  
plt.show()

输出: