differing properties (transparency and color) between arrow head and shaft in quiver

Viewed 328

I know how to set colours for arrows using quiver in matplotlib as per the example below, and the code allows a good degree of flexibility concerning the size, length and width of the arrow head, but is there the possibility to change other properties separately? I specifically would like to be able to set the arrow head color and transparency different from that of the shaft

My example code:

import matplotlib.pyplot as plt
import numpy as np

fig,ax=plt.subplots()
x=np.array([0,1,3,4])
y=np.array([2,4,0,1])
ax.quiver(x[:-1],y[:-1],x[1:]-x[:-1],y[1:]-y[:-1], angles='xy', scale_units='xy', scale=1,linewidth=1,color="red")

Produces standard red arrows, e.g. enter image description here

can I make the shaft transparent with alpha while leaving the head untouched? ...and also give it a different colour? Or is there an alternative to quiver I should be looking at ? I presume quiver is built around the arrow command, but in the arrow documentation I can't see any options to separately specify the arrow head color or other properties, only the size and appearance.

0 Answers
Related