[Matplotlib-users] Tex-style factorial ! in legend

2012-09-25 Thread andreasl

Hello,

When I use something along the lines of

legend( (r'$0.5^x/x!$', r'$1^x/x!$') )

for some reason omegas are drawn instead of the ! sign. I can't find an 
alternative here  nor 
elsewhere. Any ideas?


Many thanks,

Andreas

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Tex-style factorial ! in legend

2012-09-25 Thread andreasl

On 25/09/12 11:44, Damon McDougall wrote:

On Tue, Sep 25, 2012 at 11:10 AM, andreasl  wrote:

Hello,

When I use something along the lines of

legend( (r'$0.5^x/x!$', r'$1^x/x!$') )

for some reason omegas are drawn instead of the ! sign. I can't find an
alternative here nor elsewhere. Any ideas?


Looks fine to me. Do you have rcParams['text.usetex']=True?



Thanks Damon. No, I was using matplotlib's own mathtex 
<http://matplotlib.org/users/mathtext.html> rather than direct LaTeX 
support <http://matplotlib.org/users/usetex.html>. If I do set usetex to 
True, trying to plot anything results in errors, the output including:



! LaTeX Error: File `type1cm.sty' not found.

This issue is mentioned 
<http://matplotlib.org/users/usetex.html#possible-hangups> on the 
matplotlib webpage (I am using Ubuntu-derived Mint). I'm not keen to 
install type1cm as part of Mint's space-chomping 485MB 
texlive-latex-extra package. May figure out how to install it 
individually; if anyone has experience with this, please shout. Cheers.
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Tex-style factorial ! in legend

2012-09-25 Thread andreasl
Thanks Mike. Interesting that it works for you with mathtext only.

I am in some confusion about the matplotlib version I'm using. Synaptic 
(package manager) says that for matplotlib I have 
0.99.1.2-3ubuntu1installed. Asking for help(matplotlib) in python gives

> FILE
> /usr/local/lib/python2.6/dist-packages/matplotlib-1.0.1-py2.6-linux-i686.egg/matplotlib/__init__.py

I did not change anything manually in matplotlibrc, of which I seem to 
have three versions:

> /etc/matplotlibrc
> /usr/local/lib/python2.6/dist-packages/matplotlib/mpl-data/matplotlibrc
> /usr/local/lib/python2.6/dist-packages/matplotlib-1.0.1-py2.6-linux-i686.egg/matplotlib/mpl-data/matplotlibrc

The first one has backend: TkAgg whereas the other two have backend: 
GTKAgg. Everything else is commented out. I usually work from within the 
Spyder IDE, where the backend is set (via Preferences) to Qt4Agg. I get 
the faulty behaviour (omega instead of !) both from within Spyder and 
from within a console ipython session (where presumably either TkAgg or 
GTKAgg is used). Setting the backend to either TkAgg or GTKAgg in Spyder 
results in no plot at all.


On 25/09/12 19:05, matplotlib-users-requ...@lists.sourceforge.net wrote:
> Message: 1
> Date: Tue, 25 Sep 2012 09:01:14 -0400
> From: Michael Droettboom 
> Subject: Re: [Matplotlib-users] Tex-style factorial ! in legend
> To: 
> Message-ID: <5061ab1a.8020...@stsci.edu>
> Content-Type: text/plain; charset="iso-8859-1"
>
> This is working for me, even with text.usetex set to "False".  What
> version of matplotlib are you using?  Do you have anything set in your
> matplotlibrc file?
>
> Mike
>
> On 09/25/2012 06:10 AM, andreasl wrote:
>> Hello,
>>
>> When I use something along the lines of
>>
>> legend( (r'$0.5^x/x!$', r'$1^x/x!$') )
>>
>> for some reason omegas are drawn instead of the ! sign. I can't find
>> an alternative here <http://matplotlib.org/users/mathtext.html> nor
>> elsewhere. Any ideas?
>>
>> Many thanks,
>>
>> Andreas


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users