> You could use html image maps to accomplish this.
> Obviously this would be in the context of a web page. I
> think frontpage or dreamweaver has some nice tools for
> creating these. Just google "html image maps" for more
Andrew Dalke has a tutorial on creating html image maps with
This tutorial was a start. I want to do a similar thing, but use
rectangle objects for the image map, whose coordinates are derived
from matplotlib polygon objects. I was wondering if anyone knew how
to do this, or could point me to some documentation.
Basically I have a simple figure:
from pylab import *
fig = figure(1,(4,4))
ax = axis()
pl = plot(range(0,10),range(0,10),'b-')
box = axvspan(3,5,fc='m',alpha=0.5)
#get vertices [(ul.x,ul.y),(lr.x,lr.y)]
#ul = upper left
#lr = lower right
#have to multiply ul.y by the upper ylim since for axvspan, ul.y=1
spans the range
b_verts = box.get_verts()
verts = [(b_verts,b_verts*ax.get_ylim()),(b_verts,b_verts)]
my question is what transform do I use to convert verts to pixel coordinates?
ax.get_transform() does not work. Should I use pl.get_transform?
Thanks for your help!
On 2/15/06, John Hunter <jdhunter@...4...> wrote: