两天来,我一直试图解决这个问题 . 我正在绘制上限,所以我需要向下箭头指向我的点 . 除此之外,我现在尝试使用Plt.Error获取这些箭头 . 问题是,箭头的尾端指向该点而不是尖端 .
下面,我展示了用于绘制此数据的代码,省略了我在数据中读取的部分 . 另外,我添加了两张图片 . 第一张图是结果图 . 第二个图像是该图中的黄色箭头,指的是点(10,.0076),您可以清楚地看到箭头的尾端指向该坐标 .
导入matplotlib.pyplot作为plt import numpy as np import pylab
f1 = plt.figure(0)
plt.errorbar(days,fluxdensity,yerr=0.01,uplims=True,linestyle='none',markeredgewidth=5,elinewidth=5)
plt.errorbar(days2, fluxdensity2, yerr=0.01,uplims=True,linestyle='none',markeredgewidth=5,elinewidth=5)
plt.errorbar(days3, fluxdensity3, yerr=0.01,uplims=True,linestyle='none',markeredgewidth=5,elinewidth=5)
plt.errorbar(days4, fluxdensity4,yerr=0.01,uplims=True,linestyle='none',markeredgewidth=5,elinewidth=5)
plt.grid()
plt.xlabel('Days Since Explosion', fontsize=18)
plt.ylabel('Flux Density muJy', fontsize=16)
plt.savefig('2014dtflux.pdf',format='pdf')
plt.xlim((9.9,10.1))
plt.ylim((-.03,.12))
plt.show()
Example of One Point Showing That The Tail of the Arrow is Pointing at (10,.0076)
1 回答
看来你想画一个箭头 . 要在matplotlib中绘制箭头,可以使用
FancyArrowPatch
.