from kapteyn import maputils from matplotlib import pyplot as plt info = """\nCode shows complete control over the Axes objects for image and colorbar. Often, this appoach takes more time to configure but it gives much more control. When resizing the plot window, the colorbar does not always follow the width or heigth of the image.\n""" print(info) fitsobj = maputils.FITSimage("m101.fits") fig = plt.figure(figsize=(7,7.5)) frame = fig.add_axes((0.2, 0.25, 0.7, 0.7)) cbframe = fig.add_axes((0.2, 0.1, 0.7, 0.05)) annim = fitsobj.Annotatedimage(cmap="jet", clipmin=8000, frame=frame) annim.Image() annim.Graticule() units = r'$ergs/(sec.cm^2)$' colbar = annim.Colorbar(fontsize=8, orientation='horizontal', frame=cbframe) colbar.set_label(label=units, fontsize=14) annim.plot() annim.interact_imagecolors() plt.show()