这是我在xy平面的图形上画线的代码。我想为每一条线显示一条弧,并在其上表示角度。在
sim_score =[0.993832,0.543218,0.234745 ,0.873513,0.234565,0.789212]
plt.figure()
for i in sim_score:
for j in sim_label:
a= math.acos(i)
b = a * 180 / math.pi
point=(0,0)
x,y = point
length=10
# find the end point
endy = length * math.sin(math.radians(b))
endx = length * math.cos(math.radians(b))
# plot the points
ax = plt.subplot(111)
# set the bounds to be 10, 10
ax.set_ylim([0, 10])
ax.set_xlim([0, 10])
ax.plot([x, endx], [y,endy] )
我想做一个带角度的弧作为标签。在
在this post之后,我对代码源进行了调整,使其具有良好的基础:
你应该调整程序来放置标签,我刚刚做了一个快速的位置演算
结果图:
相关问题 更多 >
编程相关推荐