Hi, I'm quite new to python and matplotlib, but at least simple graphs work already. But now I tried to use tex for processing labels.
tex, latex, dvipng and ghostscript are in my path. A manual tex-run on the tex file produces a dvi file. Any help is appreciated Wolfgang PS: I'm runnin on WinXP prof ########################################################################## My script: 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() ########################################################################## And here the error: >pythonw -u "tex.py" Traceback (most recent call last): File "tex.py", line 16, in ? savefig('tex_demo') File "d:\programme\python2.4.3\lib\site-packages\matplotlib-0.87.3-py2.4-win32.egg\matplotlib\pylab.py", line 811, in savefig return fig.savefig(*args, **kwargs) File "d:\programme\python2.4.3\lib\site-packages\matplotlib-0.87.3-py2.4-win32.egg\matplotlib\figure.py", line 660, in savefig self.canvas.print_figure(*args, **kwargs) File "d:\programme\python2.4.3\lib\site-packages\matplotlib-0.87.3-py2.4-win32.egg\matplotlib\backends\backend_tkagg.py", line 184, in print_figure agg.print_figure(filename, dpi, facecolor, edgecolor, orientation, File "d:\programme\python2.4.3\lib\site-packages\matplotlib-0.87.3-py2.4-win32.egg\matplotlib\backends\backend_agg.py", line 452, in print_figure self.draw() File "d:\programme\python2.4.3\lib\site-packages\matplotlib-0.87.3-py2.4-win32.egg\matplotlib\backends\backend_agg.py", line 389, in draw self.figure.draw(renderer) File "d:\programme\python2.4.3\lib\site-packages\matplotlib-0.87.3-py2.4-win32.egg\matplotlib\figure.py", line 531, in draw for a in self.axes: a.draw(renderer) File "d:\programme\python2.4.3\lib\site-packages\matplotlib-0.87.3-py2.4-win32.egg\matplotlib\axes.py", line 1034, in draw a.draw(renderer) File "d:\programme\python2.4.3\lib\site-packages\matplotlib-0.87.3-py2.4-win32.egg\matplotlib\axis.py", line 561, in draw tick.draw(renderer) File "d:\programme\python2.4.3\lib\site-packages\matplotlib-0.87.3-py2.4-win32.egg\matplotlib\axis.py", line 161, in draw if self.label1On: self.label1.draw(renderer) File "d:\programme\python2.4.3\lib\site-packages\matplotlib-0.87.3-py2.4-win32.egg\matplotlib\text.py", line 1167, in draw Text.draw(self, renderer) File "d:\programme\python2.4.3\lib\site-packages\matplotlib-0.87.3-py2.4-win32.egg\matplotlib\text.py", line 339, in draw bbox, info = self._get_layout(renderer) File "d:\programme\python2.4.3\lib\site-packages\matplotlib-0.87.3-py2.4-win32.egg\matplotlib\text.py", line 186, in _get_layout w,h = renderer.get_text_width_height( File "d:\programme\python2.4.3\lib\site-packages\matplotlib-0.87.3-py2.4-win32.egg\matplotlib\backends\backend_agg.py", line 239, in get_text_width_height Z = texmanager.get_rgba(s, size, self.dpi.get(), rgb) File "d:\programme\python2.4.3\lib\site-packages\matplotlib-0.87.3-py2.4-win32.egg\matplotlib\texmanager.py", line 401, in get_rgba pngfile = self.make_png(tex, fontsize, dpi, force=False) File "d:\programme\python2.4.3\lib\site-packages\matplotlib-0.87.3-py2.4-win32.egg\matplotlib\texmanager.py", line 227, in make_png dvifile = self.make_dvi(tex, fontsize) File "d:\programme\python2.4.3\lib\site-packages\matplotlib-0.87.3-py2.4-win32.egg\matplotlib\texmanager.py", line 197, in make_dvi if exit_status: raise RuntimeError('LaTeX was not able to process \ RuntimeError: LaTeX was not able to process the flowing string: 0.0 Here is the full report generated by LaTeX: The system cannot find the path specified. ########################################################################## But I can run the created tex-file manually: latex -interaction=nonstopmode "3bb1bc57100b0c65915bdda3a1f60dae.tex" This is e-TeX, Version 3.141592-2.2 (MiKTeX 2.4) (preloaded format=latex 2006.6.11) 11 JUN 2006 13:52 entering extended mode **3bb1bc57100b0c65915bdda3a1f60dae.tex (3bb1bc57100b0c65915bdda3a1f60dae.tex LaTeX2e <2005/12/01> Babel <v3.8g> and hyphenation patterns for english, dumylang, nohyphenation, ge rman, ngerman, french, loaded. (C:\texmf\tex\latex\base\article.cls Document Class: article 2005/09/16 v1.4f Standard LaTeX document class (C:\texmf\tex\latex\base\size10.clo File: size10.clo 2005/09/16 v1.4f Standard LaTeX file (size option) ) [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] \abovecaptionskip=\skip41 \belowcaptionskip=\skip42 \bibindent=\dimen102 ) (C:\texmf\tex\latex\type1cm\type1cm.sty Package: type1cm 2002/09/05 v0.04 BlueSky/Y&Y Type1 CM font definitions (DPC, p atched RF) ) (C:\texmf\tex\latex\psnfss\helvet.sty Package: helvet 2005/04/12 PSNFSS-v9.2a (WaS) (C:\texmf\tex\latex\graphics\keyval.sty Package: keyval 1999/03/16 v1.13 key=value parser (DPC) [EMAIL PROTECTED]@=\toks14 )) (C:\texmf\tex\latex\psnfss\courier.sty Package: courier 2005/04/12 PSNFSS-v9.2a (WaS) ) (C:\texmf\tex\latex\base\textcomp.sty Package: textcomp 2005/09/27 v1.99g Standard LaTeX package Package textcomp Info: Sub-encoding information: (textcomp) 5 = only ISO-Adobe without \textcurrency (textcomp) 4 = 5 + \texteuro (textcomp) 3 = 4 + \textohm (textcomp) 2 = 3 + \textestimated + \textcurrency (textcomp) 1 = TS1 - \textcircled - \t (textcomp) 0 = TS1 (full) (textcomp) Font families with sub-encoding setting implement (textcomp) only a restricted character set as indicated. (textcomp) Family '?' is the default used for unknown fonts. (textcomp) See the documentation for details. Package textcomp Info: Setting ? sub-encoding to TS1/1 on input line 71. (C:\texmf\tex\latex\base\ts1enc.def File: ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file ) LaTeX Info: Redefining \oldstylenums on input line 266. Package textcomp Info: Setting cmr sub-encoding to TS1/0 on input line 281. Package textcomp Info: Setting cmss sub-encoding to TS1/0 on input line 282. Package textcomp Info: Setting cmtt sub-encoding to TS1/0 on input line 283. Package textcomp Info: Setting cmvtt sub-encoding to TS1/0 on input line 284. Package textcomp Info: Setting cmbr sub-encoding to TS1/0 on input line 285. Package textcomp Info: Setting cmtl sub-encoding to TS1/0 on input line 286. Package textcomp Info: Setting ccr sub-encoding to TS1/0 on input line 287. Package textcomp Info: Setting ptm sub-encoding to TS1/4 on input line 288. Package textcomp Info: Setting pcr sub-encoding to TS1/4 on input line 289. Package textcomp Info: Setting phv sub-encoding to TS1/4 on input line 290. Package textcomp Info: Setting ppl sub-encoding to TS1/3 on input line 291. Package textcomp Info: Setting pag sub-encoding to TS1/4 on input line 292. Package textcomp Info: Setting pbk sub-encoding to TS1/4 on input line 293. Package textcomp Info: Setting pnc sub-encoding to TS1/4 on input line 294. Package textcomp Info: Setting pzc sub-encoding to TS1/4 on input line 295. Package textcomp Info: Setting bch sub-encoding to TS1/4 on input line 296. Package textcomp Info: Setting put sub-encoding to TS1/5 on input line 297. Package textcomp Info: Setting uag sub-encoding to TS1/5 on input line 298. Package textcomp Info: Setting ugq sub-encoding to TS1/5 on input line 299. Package textcomp Info: Setting ul8 sub-encoding to TS1/4 on input line 300. Package textcomp Info: Setting ul9 sub-encoding to TS1/4 on input line 301. Package textcomp Info: Setting augie sub-encoding to TS1/5 on input line 302. Package textcomp Info: Setting dayrom sub-encoding to TS1/3 on input line 303. Package textcomp Info: Setting dayroms sub-encoding to TS1/3 on input line 304. Package textcomp Info: Setting pxr sub-encoding to TS1/0 on input line 305. Package textcomp Info: Setting pxss sub-encoding to TS1/0 on input line 306. Package textcomp Info: Setting pxtt sub-encoding to TS1/0 on input line 307. Package textcomp Info: Setting txr sub-encoding to TS1/0 on input line 308. Package textcomp Info: Setting txss sub-encoding to TS1/0 on input line 309. Package textcomp Info: Setting txtt sub-encoding to TS1/0 on input line 310. Package textcomp Info: Setting futs sub-encoding to TS1/4 on input line 311. Package textcomp Info: Setting futx sub-encoding to TS1/4 on input line 312. Package textcomp Info: Setting futj sub-encoding to TS1/4 on input line 313. Package textcomp Info: Setting hlh sub-encoding to TS1/3 on input line 314. Package textcomp Info: Setting hls sub-encoding to TS1/3 on input line 315. Package textcomp Info: Setting hlst sub-encoding to TS1/3 on input line 316. Package textcomp Info: Setting hlct sub-encoding to TS1/5 on input line 317. Package textcomp Info: Setting hlx sub-encoding to TS1/5 on input line 318. Package textcomp Info: Setting hlce sub-encoding to TS1/5 on input line 319. Package textcomp Info: Setting hlcn sub-encoding to TS1/5 on input line 320. Package textcomp Info: Setting hlcw sub-encoding to TS1/5 on input line 321. Package textcomp Info: Setting hlcf sub-encoding to TS1/5 on input line 322. Package textcomp Info: Setting pplx sub-encoding to TS1/3 on input line 323. Package textcomp Info: Setting pplj sub-encoding to TS1/3 on input line 324. Package textcomp Info: Setting ptmx sub-encoding to TS1/4 on input line 325. Package textcomp Info: Setting ptmj sub-encoding to TS1/4 on input line 326. ) (C:\texmf\tex\latex\geometry\geometry.sty Package: geometry 2002/07/08 v3.2 Page Geometry [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]@tempcnt=\count89 [EMAIL PROTECTED] [EMAIL PROTECTED]@mp=\dimen104 [EMAIL PROTECTED]@mp=\dimen105 [EMAIL PROTECTED]@mp=\dimen106 [EMAIL PROTECTED] (C:\texmf\tex\latex\geometry\geometry.cfg) Package geometry Warning: Over-specification in `h'-direction. `width' (5058.9pt) is ignored. Package geometry Warning: Over-specification in `v'-direction. `height' (5058.9pt) is ignored. ) No file 3bb1bc57100b0c65915bdda3a1f60dae.aux. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 9. LaTeX Font Info: ... okay on input line 9. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 9. LaTeX Font Info: ... okay on input line 9. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 9. LaTeX Font Info: ... okay on input line 9. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 9. LaTeX Font Info: ... okay on input line 9. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 9. LaTeX Font Info: ... okay on input line 9. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 9. LaTeX Font Info: ... okay on input line 9. LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 9. LaTeX Font Info: Try loading font information for TS1+cmr on input line 9. (C:\texmf\tex\latex\base\ts1cmr.fd File: ts1cmr.fd 1999/05/25 v2.5h Standard LaTeX font definitions ) LaTeX Font Info: ... okay on input line 9. LaTeX Font Info: Try loading font information for OT1+pnc on input line 9. (C:\texmf\tex\latex\psnfss\ot1pnc.fd File: ot1pnc.fd 2001/06/04 font definitions for OT1/pnc. ) -------------------- Geometry parameters paper: user defined landscape: -- twocolumn: -- twoside: -- asymmetric: -- h-parts: 72.26999pt, 5058.90001pt, 72.26999pt v-parts: 72.26999pt, 5058.90001pt, 72.26999pt hmarginratio: -- vmarginratio: -- lines: -- heightrounded: -- bindingoffset: 0.0pt truedimen: -- includehead: -- includefoot: -- includemp: -- driver: -------------------- Page layout dimensions and switches \paperwidth 5203.43999pt \paperheight 5203.43999pt \textwidth 5058.90001pt \textheight 5058.90001pt \oddsidemargin 0.0pt \evensidemargin 0.0pt \topmargin -37.0pt \headheight 12.0pt \headsep 25.0pt \footskip 30.0pt \marginparwidth 65.0pt \marginparsep 11.0pt \columnsep 10.0pt \skip\footins 9.0pt plus 4.0pt minus 2.0pt \hoffset 0.0pt \voffset 0.0pt \mag 1000 (1in=72.27pt, 1cm=28.45pt) ----------------------- LaTeX Font Info: Try loading font information for OT1+phv on input line 10. (C:\texmf\tex\latex\psnfss\ot1phv.fd File: ot1phv.fd 2001/06/04 scalable font definitions for OT1/phv. ) [1 ] (3bb1bc57100b0c65915bdda3a1f60dae.aux) ) Here is how much of TeX's memory you used: 1241 strings out of 95889 17222 string characters out of 1195257 57891 words of memory out of 1061592 4295 multiletter control sequences out of 60000 5188 words of font info for 17 fonts, out of 1000000 for 2000 14 hyphenation exceptions out of 4999 24i,4n,32p,229b,105s stack positions out of 5000i,500n,10000p,200000b,32768s Output written on 3bb1bc57100b0c65915bdda3a1f60dae.dvi (1 page, 208 bytes). _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users