Ejemplo n.º 1
0
 def offset_image(coord, name, ax):
     img = get_flag(name)
     im = OffsetImage(img, zoom=0.2)
     im.image.axes = ax
     textt = TextArea("%02d" % (coord + 1))
     textt.axes = ax
     ab = AnnotationBbox(im, (0, coord),
                         xybox=(-30., 0.),
                         frameon=True,
                         xycoords='data',
                         boxcoords="offset points",
                         pad=0)
     text = AnnotationBbox(textt, (0, coord),
                           xybox=(-11., 0.),
                           frameon=False,
                           xycoords='data',
                           boxcoords="offset points",
                           pad=0)
     ax.add_artist(text)
     ax.add_artist(ab)