<div dir="ltr">Hi Vittorio,<div><br></div><div>Apologies for the delay - I think that these issues should be resolved with the latest version of APLpy (2.0.3) but if not, please open an issue here:</div><div><br></div><div><a href="https://github.com/aplpy/aplpy/issues">https://github.com/aplpy/aplpy/issues</a><br></div><div><br></div><div>Thanks!</div><div>Tom</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 31 Oct 2017 at 18:29, Vittorio_Roma2 <<a href="mailto:vittorio.braga@roma2.infn.it">vittorio.braga@roma2.infn.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear all<br>
<br>
I am having a problem with aplpy.<br>
<br>
I am using Python 3.5.2 under ubuntu 16.04 and installed aplpy version 1.1.1<br>
<br>
through pip3 install aplpy<br>
<br>
<br>
The first problem arises when importing aplpy:<br>
<br>
<br>
import/home/vittorio/.local/lib/python3.5/site-packages/matplotlib/cbook/deprecation.py:106: <br>
MatplotlibDeprecationWarning: The mpl_toolkits.axes_grid module was <br>
deprecated in version 2.1. Use mpl_toolkits.axes_grid1 and <br>
mpl_toolkits.axisartist provies the same functionality instead.<br>
   warnings.warn(message, mplDeprecation, stacklevel=1)<br>
<br>
I have tried to substitute mpl_toolkits.axes_grid1 with <br>
mpl_toolkits.axes_grid in core.py<br>
<br>
but then I got an error (and not a warning)  saying that axes_grid1 does <br>
not have some method.<br>
<br>
This will just return a failure and stop everything.<br>
<br>
<br>
Anyways, when I do<br>
<br>
 >>> fitsfile='somefile.fits'<br>
 >>> F=aplpy.FITSFigure(fitsfile)<br>
WARNING: Cannot determine equinox. Assuming J2000. [aplpy.wcs_util]<br>
WARNING: Cannot determine equinox. Assuming J2000. [aplpy.wcs_util]<br>
 >>> F.show_grayscale()<br>
INFO: Auto-setting vmin to  3.416e+03 [aplpy.core]<br>
INFO: Auto-setting vmax to  2.212e+04 [aplpy.core]<br>
<br>
<br>
No window at all is opening. I have also tried giving as input of FITSFIgure<br>
astropy.io.fits.open objects but again, no graphical window shows up.<br>
<br>
I have found some workaround, that is, after the above instructions, to give<br>
<br>
 >>>hdu_list=fits.open(fitsfile)<br>
 >>>image_data=hdu_list[0].data<br>
 >>>plt.imshow(image_data,'gray',clim=[4500,9000])<br>
 >>>plt.show(block=False)<br>
<br>
This does open an astrometrized image, with the labels of the X and Y axis<br>
in the right place. However, this does not allow me to use any of the<br>
FITSFigure methods. Neither I can add subplots to put annotations. Finally,<br>
to add markers, I am forced to do another workaround: to<br>
give pixel coordinates like this<br>
<br>
 >>>plt.scatter(pixcoords[:,0],pixcoords[:,1])<br>
<br>
where pixcoords comes from WCS transformations.<br>
<br>
I have also tried a workaround, giving,e.g.<br>
<br>
 >>>F.add_label(0.5,0.5,'ssss',relative=True)<br>
<br>
and do the plt.imshow and plt.show later, but this still does not work.<br>
<br>
To sum up, while it is true that  I can live with the workarounds for some<br>
very basic figures, all of this is slowing down the script and I can't call<br>
any of the FITSFigure methods<br>
<br>
Any help would really be appreciated<br>
<br>
Best regards, Vittorio<br>
_______________________________________________<br>
AstroPy mailing list<br>
<a href="mailto:AstroPy@python.org" target="_blank">AstroPy@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/astropy" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/astropy</a><br>
</blockquote></div>