matplotlib
关于使用's绘制适合图像的问题,我遇到了一些问题imshow
。似乎我的图像水平和垂直翻转。我敢肯定,我忽略了一些简单的事情,如果有人能指出我正确的方向,那就太好了。
这就是我的图像应该是什么样子:
因此,我将图像加载为:
from astropy.io import fits
import matplotlib
import matplotlib.pyplot as pyplot
#Opening/reading in my fits file
hdulist = fits.open('.../myfits.fits')
#Accessing the image data and specifying the dimensions I wish to use
my_image = hdulist[0].data[0,0:,0:]
#Plotting the image
pyplot.imshow(image_SWIFT_uvm2_plot, cmap='gray', vmin=0, vmax=0.5)
pyplot.show()
这就是我在情节中的形象(情节比我包含的代码复杂一点,但我已经给出了关键行,希望是一个自给自足的代码):
那些眼睛敏锐的人应该会看到图像在水平和垂直方向上都发生了翻转。