我试图在matplotlib中添加一个复杂的箭头形状来表示"跳转"."(见草图)
生成"井"的代码足够简单,这里供参考.
import matplotlib.pyplot as plt
import numpy as np
fig,ax = plt.subplots(dpi=100)
fig.patch.set_alpha(0.9)
L=2
def well(x,depth=10,centre=0,flatten=0.2):
return -depth * np.exp(-0.5 * ((x-centre)/flatten)**2)
wells=[-2*L,-1*L,0,L,2*L]
wells_xs=[]
for centre in wells:
wells_xs.append(np.linspace(centre-0.5*L,centre+0.5*L,100))
for center,space in zip(wells,wells_xs):
d=8 if center==0 else 1
flatten=0.3 if center==0 else 0.4
ax.plot(space,well(space,d,center,flatten),'deepskyblue')
plt.show()
我试图表明一个 idea ,即某个东西从右边的"坑"跳到深井,越过"小山"."所以直接从A指向B的箭头看起来不对. [3][2][3][2][3][2][3][2][3] X轴)