I plot an arrow as below, whilst I think it's a little bit big. How can I make it thinner and smaller? Thank you
for i in range(len(x)):
plt.annotate(df.index[i],xy=(x[i],y[i]),xytext=(x[i]+1.31,y[i]-0.55),arrowprops=dict(facecolor='blue', shrink=0.1))
Hence, to increase the arrow's head size, you must use the mutation_scale key. import matplotlib. pyplot as plt fig, ax = plt. subplots(figsize = (5, 5)) plt.
Quiver plot is basically a type of 2D plot which shows vector lines as arrows. This type of plots are useful in Electrical engineers to visualize electrical potential and show stress gradients in Mechanical engineering.
You should try adjusting the width
parameter (from the docs)
plt.annotate(df.index[i],
xy=(x[i],y[i]), xytext=(x[i]+1.31,y[i]-0.55),
arrowprops=dict(facecolor='blue', shrink=0.1, width=2)
)
I've adjusted your snippet to make the parameter more obvious. Note also that width
is in points, so you may need to try a few different values out. Other values worth looking at are frac
. headwidth
and shrink
(also in the docs), especially if you want to make the head smaller too!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With