0

I want to embed a zoomed portion of a FITS image in the same plot with APLpy.

But when loading a FITS file with APLpy, there is only a 'FITSFigure' object returned.

fig = aplpy.FITSFigure('tmp.fits', slices=[0,0])

Is it possible to make it work with zoomed_inset_axes like here , or there are some other solution?

gerry
  • 1,539
  • 1
  • 12
  • 22

1 Answers1

3

You may specify the figure to which to plot with aplpy. You can then get the axes inside the figure.

fig = plt.figure()
aplpyfig = aplpy.FITSFigure('tmp.fits', figure=fig)
axes = fig.get_axes()

From that point onwards you can work with that axes and use any of the methods that matplotlib offers to obtain insets.

Also see this question: Aplpy multiplot dynamic axis sharing

ImportanceOfBeingErnest
  • 321,279
  • 53
  • 665
  • 712
  • 1
    Thank you ! I did not make it work with zoomed_inset_axes. But I got what I want with aplpy.FITSFigure('tmp.fits', figure=fig,suplot=[0.6,0.6,0.2,0.25]) – gerry Jul 10 '17 at 13:40