0

I'd like to scale images that I display in jupyter qtconsole to window width.

All images are shown just in the size of 5x5cm, nevertheless how large they really are. Tried that with a 1k by 1k image and a 7,7k by 7,7k image. Shows the same. I don't think it's a matter of astropy but matplotlib or jupyter qtconsole. Couldn't find anything on docu of matplotlib or jupyter qtconsole.

code is:

`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()`
camaro
  • 118
  • 12
  • it's not duplicate because I like to know how to scale the figure to window's width automatically – camaro Apr 13 '18 at 22:09
  • Secondly, my question was concentrated on jupyter-qtconsole, because in a program, there would be the use of a figure and not imshow. – camaro Apr 19 '18 at 10:26

1 Answers1

0

Does

import matplotlib
matplotlib.rcParams['figure.figsize'] = (10.,10.)

have any effect?

py_eyed
  • 1
  • 2
  • yes that works for manually setting the figure size but not for automatically setting it to jupyter window size. Thanks for that. Thought there might be some more sophisticated solution. – camaro Apr 13 '18 at 22:15