此问题已在此处有答案:
Putting arrowheads on vectors in a 3d plot(3个答案)
1年前关闭。
你能把这个箭头做成3D的吗?
import matplotlib.patches as patches
style="Simple,tail_width=0.5,head_width=4,head_length=8"
kw = dict(arrowstyle=style, color=b)
a3 = patches.FancyArrowPatch((0, 0), (99, 100),connectionstyle="arc3,rad=-0.3", **kw, lw=cfg._sections['styles'].get('arrows'))
我试过:
import matplotlib.patches as patches
style="Simple,tail_width=0.5,head_width=4,head_length=8"
kw = dict(arrowstyle=style, color=b)
a3 = patches.FancyArrowPatch((0, 0), (1, 1), (0.5, 1.5),connectionstyle="arc3,rad=-0.3", **kw, lw=cfg._sections['styles'].get('arrows'))
错误是:
a3 = patches.FancyArrowPatch((0, 0), (1, 1), (0.5, 1.5),connectionstyle="arc3,rad=-0.3", **kw, lw=1)
File "/home/linux/.local/lib/python3.6/site-packages/matplotlib/patches.py", line 4068, in __init__
raise ValueError("either posA and posB, or path need to provided")
ValueError: either posA and posB, or path need to provided
或者至少把箭头的头放在3d图中的一个点上?
1条答案
按热度按时间11dmarpk1#
您需要一个自定义函数来实现此功能。你可以使用类似这样的东西:
来源:https://stackoverflow.com/a/22867877/5025009