Пример #1
0
fi.get_bindings().enable_all(True)

# load an image
if len(sys.argv) < 2:
    print "Please provide a FITS file on the command line"
    sys.exit(1)
    
image = AstroImage(logger)
image.load_file(sys.argv[1])
fi.set_image(image)
#fi.rotate(45)

# plot some example graphics via matplotlib

# Note adding axis from ginga (mpl backend) object
ax = fi.add_axes()
ax.hold(True)

wd, ht = image.get_size()
# plot a line
l = ax.plot((wd*0.33, wd*0.75), (ht*0.5, ht*0.75), 'go-',
            c="g",
            label='line1')
# a rect
r = patches.Rectangle((wd*0.10, ht*0.10), wd*0.6, ht*0.5, ec='b',
                      fill=False)
ax.add_patch(r)

# if you rotate, flip, zoom or pan the the ginga image the graphics
# stay properly plotted.  See quickref of interactive ginga commands here:
#    http://ginga.readthedocs.org/en/latest/quickref.html