我试图在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()根据读取文档,这应该可以工作,reference.html
https://stackoverflow.com/questions/35271978
复制相似问题