简体   繁体   English

如何使用APLpy在同一图中嵌入FITS图像的缩放部分

[英]How to embed a zoomed portion of a FITS image in the same plot with APLpy

I want to embed a zoomed portion of a FITS image in the same plot with APLpy . 我想使用APLpy在同一图中嵌入FITS图像的缩放部分。

But when loading a FITS file with APLpy, there is only a 'FITSFigure' object returned. 但是,使用APLpy加载FITS文件时,仅返回“ FITSFigure”对象。

fig = aplpy.FITSFigure('tmp.fits', slices=[0,0])

Is it possible to make it work with zoomed_inset_axes like here , or there are some other solution? 是否可以使它像这里的 zoomed_inset_axes一样工作,还是有其他解决方案?

You may specify the figure to which to plot with aplpy. 您可以使用aplpy指定要绘制的图形。 You can then get the axes inside the figure. 然后,您可以将轴放入图中。

fig = plt.figure()
aplpyfig = aplpy.FITSFigure('tmp.fits', figure=fig)
axes = fig.get_axes()

From that point onwards you can work with that axes and use any of the methods that matplotlib offers to obtain insets. 从那时起,您可以使用该axes并使用matplotlib提供的任何方法来获取插图。

Also see this question: Aplpy multiplot dynamic axis sharing 另请参阅以下问题: Aplpy多图动态轴共享

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM