我正在处理一些天文学数据,并试图在背景图像上绘制矢量图。为了使其正确安装,轴值应匹配。我图像中的坐标不同于我必须绘图的坐标。为了变换坐标,使用了函数变换。但这对我不起作用。
注意:变换功能对散点图有效,但对颤动图却不起作用
任何帮助将不胜感激。谢谢!
phot1 = pd.read_csv(r'C:\Users\Admin\Desktop\New folder\6 SEM Python\WORK\NEW\8. TAN_Stdev_207.csv')
axes=[]
gs = gridspec.GridSpec(nrows=2,ncols=5)
axes00 = plt.subplot(gs[0,0:2], projection=wcs)
axes02 = plt.subplot(gs[0,3:5],projection=wcs)
#axes[0][0]=fig.add_subplot(2,2,1,projection=wcs)
axes00.imshow(hdu[0].data)
axes00.scatter(phot1['ra_1'],phot1['dec_1'], transform=axes00.get_transform('fk5'),s=10, edgecolor='black',facecolor='none')
axes00.set_xlabel("ra_1")
axes00.set_ylabel("dec_1")
axes02.imshow(hdu[0].data,cmap='GnBu')
axes02.quiver(phot['ra_1'],phot['dec_1'],phot['pmra'],phot['pmdec'],color='b',alpha=0.5,width=0.003)
im =axes02.scatter(phot1['ra_1'],phot1['dec_1'],s=5,c='g',transform=axes02.get_transform('fk5'))
axes02.quiver(phot1['ra_1'],phot1['dec_1'],phot1['pmra'],phot1['pmdec'],transform=axes02.get_transform('fk5'),color='g',alpha=0.5,width=0.005)
plt.colorbar(im,ax=axes02,shrink=0.8)
axes02.set_xlabel("ra_1")
axes02.set_ylabel("dec_1")
plt.tight_layout()
plt.gcf().set_size_inches((20, 20))
plt.show()