【发布时间】:2018-04-12 16:24:45
【问题描述】:
我想将我在 jupyter qtconsole 中显示的图像缩放到窗口宽度。
所有图片仅以 5x5cm 的尺寸显示,但它们实际上有多大。尝试使用 1k x 1k 图像和 7,7k x 7,7k 图像。显示相同。 我认为这不是 astropy 的问题,而是 matplotlib 或 jupyter qtconsole。 在 matplotlib 或 jupyter qtconsole 的文档中找不到任何内容。
代码是:
`from astropy.io import fits
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
img_file = 'rxcj0920.1+8602.fits' # 1kx1k
hdu_list = fits.open(img_file)
img_data = hdu_list[0].data
plt.imshow(img_data, cmap='gist_heat', origin='lower', norm=LogNorm(), vmin=400, vmax= 65e3), plt.colorbar()`
【问题讨论】:
-
它不是重复的,因为我想知道如何将图形自动缩放到窗口的宽度
-
其次,我的问题集中在jupyter-qtconsole上,因为在程序中,会使用数字而不是imshow。
标签: matplotlib jupyter python-3.6 image-scaling qtconsole