Re: [matplotlib-devel] Canvas HTML5 backend

2009-09-01 Thread Jae-Joon Lee
On Tue, Sep 1, 2009 at 6:03 PM, Michael Thompson wrote: > I see firefox 3.5 (html5) has a method to measure the width of the > text, I'll look at using this in a javascript function to render the > text. I'm not sure if this helps. *Matplotlib* (not the browser) needs to know the size of the text

Re: [matplotlib-devel] Canvas HTML5 backend

2009-09-01 Thread Michael Thompson
2009/9/1 Jae-Joon Lee : > My understanding is that all the backends should use left-bottom > alignment. Text alignment in matplotlib is handled by mpl itself (not > by the backend), and for this to work, you have to define > get_text_width_height_descent method correctly. > > The real question is h

Re: [matplotlib-devel] Canvas HTML5 backend

2009-09-01 Thread Jae-Joon Lee
On Tue, Sep 1, 2009 at 12:57 PM, Michael Thompson wrote: > 2009/9/1 John Hunter : >> On Tue, Sep 1, 2009 at 10:32 AM, Michael Thompson wrote: >>> Hi, >>>  I'm trying to work on the canvas javascript backend I found here >>> [1]. I'm trying to add text but the canvas origin is at the top left, >>> h

Re: [matplotlib-devel] Canvas HTML5 backend

2009-09-01 Thread Michael Thompson
2009/9/1 John Hunter : > On Tue, Sep 1, 2009 at 10:32 AM, Michael Thompson wrote: >> Hi, >>  I'm trying to work on the canvas javascript backend I found here >> [1]. I'm trying to add text but the canvas origin is at the top left, >> how can I transform the co-ordinates from the matplotlib to canva

Re: [matplotlib-devel] Canvas HTML5 backend

2009-09-01 Thread John Hunter
On Tue, Sep 1, 2009 at 10:32 AM, Michael Thompson wrote: > Hi, >  I'm trying to work on the canvas javascript backend I found here > [1]. I'm trying to add text but the canvas origin is at the top left, > how can I transform the co-ordinates from the matplotlib to canvas? > >    def draw_text(self,

[matplotlib-devel] Canvas HTML5 backend

2009-09-01 Thread Michael Thompson
Hi, I'm trying to work on the canvas javascript backend I found here [1]. I'm trying to add text but the canvas origin is at the top left, how can I transform the co-ordinates from the matplotlib to canvas? def draw_text(self, gc, x, y, s, prop, angle, ismath=False): ctx = self.ctx