Hi Darren,

I've made the changes you requested and committed it. (I didn't realize
that mpl-data/matplotlibrc was generated from the template -- I actually
already placed a descriptive line of text in the overwritten file.)

I'm attaching a file for the examples/ directory which I'm having
trouble checking in. I'm rushing out the door for a weekend away at the
moment, so if you can check this in, that'd be great, otherwise I'll try
again when I'm back online. I think it might be an issue with the
non-ASCII characters in the file.

I'll also update the wiki page when I get back.

-Andrew

Darren Dale wrote:
> Hi Andrew,
> 
> On Thursday 17 May 2007 10:12:09 pm Andrew Straw wrote:
>> OK, here's the patch! :)
>>
>> Andrew Straw wrote:
>>> Hi All (esp. Darren),
>>>
>>> The attached patch adds unicode support for LaTeX. Given the recent
>>> discussion about adding preambles, I thought I'd run it past here first.
>>> Anyone opposed if I check this in?
> 
> No opposition, but a couple requests. Would you add a commented out line to 
> matplotlibrc.template, with some brief discussion if you think it is 
> appropriate? Also, lets make it a policy that the custom preamble always 
> appears after all other preambles in texmanager amd backend_ps.
> 
>>> Note that I specifically added the rcParam text.latex.unicode to enable
>>> this and a default False value to turn this off by default. I hope this
>>> prevents breakage for folks who don't have the ucs and inputenc latex
>>> packages installed while allowing unicode for those of us that do.
> 
> I have never used unicode with latex, will you add a nugget to 
> http://www.scipy.org/Cookbook/Matplotlib/UsingTex?
> 
> Darren

#!/usr/bin/env python
# -*- coding: latin-1 -*-
"""
This demo is tex_demo.py modified to have unicode. See that file for
more information.
"""
from matplotlib import rcParams
rcParams['text.usetex']=True
rcParams['text.latex.unicode']=True
from matplotlib.numerix import arange, cos, pi
from pylab import figure, axes, plot, xlabel, ylabel, title, \
     grid, savefig, show

figure(1)
ax = axes([0.1, 0.1, 0.8, 0.7])
t = arange(0.0, 1.0+0.01, 0.01)
s = cos(2*2*pi*t)+2
plot(t, s)

xlabel(r'\textbf{time (s)}')
s = unicode(r'\textit{Velocity (°/sec)}','latin-1')
ylabel(unicode(r'\textit{Velocity (°/sec)}','latin-1'),fontsize=16)
title(r"\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!", 
      fontsize=16, color='r')
grid(True)
savefig('tex_demo')


show()
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to