Hi:

I've been using various tweaks on the plot options available through
matplotlib, but I was keen on trying out the math typesetting so I
tried out the example in the cookbook (http://www.scipy.org/Cookbook/
Matplotlib/UsingTex) where the title has a nice Tex equation. When I
copied and pasted the tex_demo.py code and tried it (with %python as
first line in cell; this is important as I found out), I got a bunch
of error messages. Any clues?

BTW, with the text(x_coord,y_coord, '$simple Latex code$') option, it
is possible to get some simple single line typesetting done but it
bombs for slightly more complex ones.

thanks,
gani --

Here is the code:
***********************************************************
from matplotlib import rc
from matplotlib.numerix import arange, cos, pi
from pylab import figure, axes, plot, xlabel, ylabel, title, grid,
savefig, show

rc('text', usetex=True)
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)}')
ylabel(r'\textit{voltage (mV)}',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()
****************************************************************

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to