Reputation: 42329
The matplotlib.axes.Axes.quiver docs state that:
Arrow outline
linewidths and edgecolors can be used to customize the arrow outlines
However, a simple test code shows that edgecolor
apparently does nothing. Am I missing something?
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()
Upvotes: 3
Views: 1462
Reputation: 4275
It seems linewidth
parameter is set to 0 as default for plt.quiver
. Adding some sort of value in the function call starts displaying the edges of arrows. I.e.:
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', linewidth = 1)
plt.show()
Output:
Upvotes: 5