2

我正在尝试为颜色条写标题,APLpy但每次我都会收到以下错误:

AttributeError:'Colorbar' object has no attribute 'set_axis_label_text'

我正在使用的代码如下:

import aplpy
import matplotlib.pyplot as plt
fig = plt.figure()
f1 = aplpy.FITSFigure('random.fits', figure=fig)
f1.show_colorscale(stretch='arcsinh',cmap='Greys',interpolation="bicubic")
f1.add_colorbar()
f1.colorbar.set_width(0.3)
f1.colorbar.set_axis_label_text('title')
plt.show()

根据阅读文档,这应该可以工作 http://aplpy.readthedocs.org/en/v0.9.9/quick_reference.html

4

1 回答 1

2

请将 APLpy 更新到最新版本。我到处找,但我什至没有找到任何东西0.9.6。因此,该方法可能是在以后的版本中引入的。

0.9.9我认为在pull request #93中引入了为颜色条设置标签。

于 2016-02-08T14:58:29.790 回答