[matplotlib-devel] examples/widgets/menu.py and mathtex

2009-07-21 Thread Freddie Witherden
Hi all,

I was grepping the source code today for any remaining uses of  
matplotlib.mathtext in matplotlib and stumbled upon menu.py -- a menu  
demo/example.

Although it does use/import mathtex it seems to only use it for  
rendering plain (non-math) text using the to_mask function. This is  
something that mathtex has no equivalent of (and appears to be the  
only use of it).

Can anyone recommend an alternative way of writing menu.py so that it  
does not depend on mathtex?

Regards, Freddie.

--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] examples/widgets/menu.py and mathtex

2009-07-21 Thread Michael Droettboom
It would be great to restore to_mask to mathtex as it can be useful for 
GUI frameworks that require both an RGB and A buffer (rather than a 
single RGBA buffer).  Its implementation should be pretty 
straightforward, since you already have image buffer output in mathtex.

There may be a way to re-write menu.py to not depend on mathtex -- such 
as using ft2font directly.  But since mathtex will become a hard 
requirement for matplotlib anyway, it may be easiest to just add to_mask 
and update the example to use the new mathtex APIs.

Cheers,
Mike

Freddie Witherden wrote:
> Hi all,
>
> I was grepping the source code today for any remaining uses of  
> matplotlib.mathtext in matplotlib and stumbled upon menu.py -- a menu  
> demo/example.
>
> Although it does use/import mathtex it seems to only use it for  
> rendering plain (non-math) text using the to_mask function. This is  
> something that mathtex has no equivalent of (and appears to be the  
> only use of it).
>
> Can anyone recommend an alternative way of writing menu.py so that it  
> does not depend on mathtex?
>
> Regards, Freddie.
>
> --
> Enter the BlackBerry Developer Challenge  
> This is your chance to win up to $100,000 in prizes! For a limited time, 
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize  
> details at: http://p.sf.net/sfu/Challenge
> ___
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


--
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] examples/widgets/menu.py and mathtex

2009-07-21 Thread John Hunter
On Tue, Jul 21, 2009 at 10:37 AM, Michael Droettboom wrote:
> It would be great to restore to_mask to mathtex as it can be useful for
> GUI frameworks that require both an RGB and A buffer (rather than a
> single RGBA buffer).  Its implementation should be pretty
> straightforward, since you already have image buffer output in mathtex.
>
> There may be a way to re-write menu.py to not depend on mathtex -- such
> as using ft2font directly.  But since mathtex will become a hard
> requirement for matplotlib anyway, it may be easiest to just add to_mask
> and update the example to use the new mathtex APIs.

The menu code was a work in progress that I never finished, so
maintaining it is not a priority.  But supporting the to_mask in
mathtext would be nice.

JDH

--
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] please add this example: legend translucent

2009-07-21 Thread Sandro Tosi
Hi all,
I really liked the snipped John wrote in a mail some time ago, so I
mock up a very simple example to set the alpha on a legend.

It seems interesting to have such an example, also in the gallery.

Since I don't have much time to dive into the sphinx example
generation and so, I just hand you the code, asking to include it.

Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
#!/usr/bin/python
#
# Show how to add a translucent legend

# import pyplot module
import matplotlib.pyplot as plt

# draw 2 crossing lines
plt.plot([0,1], label='going up')
plt.plot([1,0], label='going down')

# add the legend in the middle of the plot
leg = plt.legend(fancybox=True, loc='center')
# set the alpha value of the legend: it will be translucent
leg.get_frame().set_alpha(0.5)

# show the plot
plt.show()
--
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] please add this example: legend translucent

2009-07-21 Thread Ryan May
On Tue, Jul 21, 2009 at 11:05 AM, Sandro Tosi  wrote:

> Hi all,
> I really liked the snipped John wrote in a mail some time ago, so I
> mock up a very simple example to set the alpha on a legend.
>
> It seems interesting to have such an example, also in the gallery.
>
> Since I don't have much time to dive into the sphinx example
> generation and so, I just hand you the code, asking to include it.


Done in 7279.  And just FYI, if you're just adding an example to a directory
that is already included in the examples gallery (I put this one in
pylab_examples), there's nothing to be changed.  It will be automatically
included.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
--
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] please add this example: legend translucent

2009-07-21 Thread Sandro Tosi
On Tue, Jul 21, 2009 at 19:32, Ryan May wrote:
> On Tue, Jul 21, 2009 at 11:05 AM, Sandro Tosi  wrote:
>>
>> Hi all,
>> I really liked the snipped John wrote in a mail some time ago, so I
>> mock up a very simple example to set the alpha on a legend.
>>
>> It seems interesting to have such an example, also in the gallery.
>>
>> Since I don't have much time to dive into the sphinx example
>> generation and so, I just hand you the code, asking to include it.
>
> Done in 7279.

Thanks!

> And just FYI, if you're just adding an example to a directory
> that is already included in the examples gallery (I put this one in
> pylab_examples), there's nothing to be changed.  It will be automatically
> included.

Oh that's nice, thanks for the information

Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

--
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel