下面的代码将使用matplotlib生成一个奇特的箭头:
import matplotlib.pyplot as plt
xy = [0.2,0.2]
xytext =[0.5,0.5]
plt.figure()
ax = plt.gca()
ax.annotate("", xy=xy, xytext=xytext,arrowprops=dict(arrowstyle="<|-", edgecolor = 'k', facecolor = 'r', shrinkA = 0, shrinkB = 0))箭头为红色,边缘为黑色。如何控制黑边的宽度?

发布于 2019-03-21 22:49:19
您可以使用linewidth参数。下面是一个例子
import matplotlib.pyplot as plt
xy = [0.2,0.2]
xytext =[0.5,0.5]
plt.figure()
ax = plt.gca()
ax.annotate("Text", xy=xy, xytext=xytext, arrowprops=dict(arrowstyle="<|-,
head_width=2, head_length=2", edgecolor = 'k', facecolor = 'r',
linewidth=4))

https://stackoverflow.com/questions/55283097
复制相似问题