2

I'm trying to write a title for a colour bar in APLpy but everytime I do I get the following error:

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

The code I'm using is the following:

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()

According to read the docs this should work http://aplpy.readthedocs.org/en/v0.9.9/quick_reference.html

Nat
  • 53
  • 7

1 Answers1

2

Please update APLpy to the newest version. I've looked everywhere but I did not even find anything on 0.9.6. So probably the method was introduced in a later release.

I think setting labels for colorbars was introduced in 0.9.9 in pull request #93.

MSeifert
  • 145,886
  • 38
  • 333
  • 352
  • that didn't appear to fix the problem – Nat Feb 08 '16 at 15:04
  • I edited the answer. I think it's because of your outdated ``APLpy`` version. Could you update it and check? Unfortunatly I didn't find 0.9.6 anywhere so I can't be sure if that's the reason. – MSeifert Feb 08 '16 at 15:29