So pylab has colormaps, but they dont work as gtk.gdk.Colormap() is there any way to convert maybe?
#--------------------------------------------------------------------------------
data = abs(np.matrix(pf.getdata('img.fits')))
data = data*(255.0/data.max())
[w,h] = np.shape(data)
cmap = pylab.get_cmap('gray')
window = gtk.Window()
pm = gtk.gdk.Pixmap(None,256,256,8)
pm.set_colormap(cmap)
gc = pm.new_gc()
pm.draw_gray_image(gc,0,0,256,256,gtk.gdk.RGB_DITHER_NONE,data)
#--------------------------------------------------------------------------------
The error message:kevin@rainier sandbox% python imgTest.py
The gdk_draw_*_image require the drawable argument to
have a specified colormap. All windows have a colormap,
however, pixmaps only have colormap by default if they
were created with a non-NULL window argument. Otherwise
a colormap must be set on them with gdk_drawable_set_colormap
kevin@rainier sandbox% python imgTest.py
Traceback (most recent call last):
File "imgTest.py", line 36, in
PyApp()
File "imgTest.py", line 25, in __init__
pm.set_colormap(cmap)
TypeError: GdkDrawable.set_colormap() argument 1 must be gtk.gdk.Colormap, not instance