Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I'd suggest using matrix_plot.

sage: import pylab
sage: from scipy import misc
sage: I = misc.lena()
sage: (matrix_plot(I)+circle((5,3),100)).show(ymax=500)

If you try this, you'll see that there are a couple bugs (?) that this unveils in how we compute limits; apparently no one has ever wanted to put a circle on an image before!

It's also possible to export images as matplotlib objects.

sage: C = circle((5,3),100)
sage: C.matplotlib()
sage: pylab.imshow(misc.lena())
<matplotlib.image.AxesImage at 0x1121f0310>

But someone else will have to answer how to combine those in native matplotlib, though it certainly isn't hard for anyone who uses mpl regularly.