matplotlib参数'edgecolor'不能与颤抖一起使用吗?

时间:2020-07-27 21:46:40

标签: python matplotlib

matplotlib.axes.Axes.quiver文档指出:

箭头轮廓

linewidths edgecolors 可用于自定义箭头轮廓

但是,简单的测试代码显示edgecolor显然没有任何作用。我想念什么吗?

import matplotlib.pyplot as plt
import numpy as np

X = np.arange(-3, 3, 1)
Y = np.arange(-3, 3, 1)
U, V = np.meshgrid(X, Y)

plt.quiver(X, Y, U, V, edgecolor='r')
plt.show()

enter image description here

1 个答案:

答案 0 :(得分:1)

似乎linewidth的参数默认设置为0。在函数调用中添加某种值开始显示箭头的边缘。即:

plt.quiver

输出:

enter image description here