首页 > 解决方案 > 绘制适合图像的放大部分?

问题描述

我正在尝试打开一个天文图像并将其绘制为图形,这是由我的代码完成的,但是,我试图将 fit 文件的一部分放大为同一图形上的子图。

import matplotlib.pyplot as plt
from astropy.visualization import astropy_mpl_style
plt.style.use(astropy_mpl_style)
from astropy.utils.data import get_pkg_data_filename
from astropy.io import fits
image_file = get_pkg_data_filename('814wmos.fits')

image_data = fits.getdata('814wmos.fits', ext=0)
plt.figure()
plt.imshow(image_data, cmap='gray')

这给了我我的 fit 文件,并绘制它,在没有“放大”坐标 [350:450,500:600] 的情况下显示/告诉我的信息很少。如何将此区域绘制为原始图像旁边的子图,大小相同(放大相同的轴)?

标签: pythonmatplotlibastropyfits

解决方案


推荐阅读