我在astropy 3.0.2
,python 3.6.5
和matplotlib 2.2.2.
上
我尝试遵循此处说明的简单说明: http://docs.astropy.org/en/stable/visualization/wcsaxes/
import matplotlib.pyplot as plt from astropy.wcs
import WCS from astropy.io
import fits from astropy.utils.data
import get_pkg_data_filename
filename = get_pkg_data_filename('galactic_center/gc_msx_e.fits')
hdu = fits.open(filename)[0]
wcs = WCS(hdu.header)
plt.subplot(projection=wcs)
plt.imshow(hdu.data, vmin=-2.e-5, vmax=2.e-4, origin='lower')
plt.grid(color='white', ls='solid') plt.xlabel('Galactic Longitude')
plt.ylabel('Galactic Latitude')
但是,我遇到了这种错误:
get_tightbbox中的文件“ C:\ Users \ DavideAngelini \ Anaconda3 \ lib \ site-packages \ matplotlib \ figure.py”,行2279 bb.append(ax.get_tightbbox(renderer,bbox_extra_artists))
TypeError:get_tightbbox()接受2个位置参数,但给出了3个
我该如何解决?