Python 3.x 如何在其中一个子图中绘制箭头?
请问如何控制箭头应该画到哪个子地块?现在是第二个,如何分配给第一个Python 3.x 如何在其中一个子图中绘制箭头?,python-3.x,matplotlib,Python 3.x,Matplotlib,请问如何控制箭头应该画到哪个子地块?现在是第二个,如何分配给第一个 import matplotlib.pyplot as plt import seaborn as sns import matplotlib.patches as patches fig, (ax1, ax2) = plt.subplots(nrows=2, sharex=True, sharey=True, figsize=(10,3)) ax1.set_xlim(0, 0.05) ax1.set_ylim(0, 1500
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.patches as patches
fig, (ax1, ax2) = plt.subplots(nrows=2, sharex=True, sharey=True, figsize=(10,3))
ax1.set_xlim(0, 0.05)
ax1.set_ylim(0, 1500)
style="Simple,tail_width=0.5,head_width=4,head_length=8"
kw = dict(arrowstyle=style, color='black')
a3 = patches.FancyArrowPatch((0, 0), (0.01, 500),connectionstyle="arc3,rad=-0.3", **kw)
for a in [a3]:
plt.gca().add_patch(a)
plt.show()
将面片直接添加到轴上如何:
# for a in [a3]:
# plt.gca().add_patch(a)
ax1.add_patch(a3)
输出:
(1)
cfg
从未定义。(2) 这会以什么方式失败?你有错误吗?请发布一个最小的,完整的,可验证的例子。对不起,我编辑了这个问题。