From: Benjamin R. <ben...@ou...> - 2011-05-16 16:00:00
|
On Mon, May 16, 2011 at 10:21 AM, Johannes Radinger <JRa...@gm...>wrote: > > -------- Original-Nachricht -------- > > Datum: Mon, 16 May 2011 09:49:24 -0500 > > Von: Benjamin Root <ben...@ou...> > > An: "mat...@li..." < > mat...@li...> > > Betreff: Re: [Matplotlib-users] [SciPy-User] use matplotlib to produce > mathathematical expression only > > > On Monday, May 16, 2011, Johannes Radinger <JRa...@gm...> wrote: > > > > > > -------- Original-Nachricht -------- > > >> Datum: Mon, 16 May 2011 08:28:49 -0500 > > >> Von: Robert Kern <rob...@gm...> > > >> An: SciPy Users List <sci...@sc...> > > >> CC: mat...@li... > > >> Betreff: Re: [Matplotlib-users] [SciPy-User] use matplotlib to produce > > mathathematical expression only > > > > > >> On Mon, May 16, 2011 at 08:21, Johannes Radinger <JRa...@gm...> > > wrote: > > >> > Hello, > > >> > > > >> > I want to produce a eps file of following mathematical expression: > > >> > > > >> > > > r'$F(x)=p*\frac{1}{s1\sqrt{2\pi}}*e^{-\frac{1}{2}*(\frac{x-m}{s1})}+(1-p)*\frac{1}{s1\sqrt{2\pi}}*e^{-\frac{1}{2}*(\frac{x-m}{s1})}$' > > >> > > > >> > is it possible to somehow missuse matplotlib for that to produce > only > > >> the function without any other plot things? Or is there a better > python > > >> library within scipy? I don't want to install the complete latex > > libraries just > > >> for producing this single eps file. > > >> > > >> Check out mathtex. It is matplotlib's TeX parsing engine and renderer > > >> broken out into a separate library: > > >> > > >> http://code.google.com/p/mathtex/ > > > > > > I also thought about mathtex but don't know how to use my mathematical > > expression without a plot of axis etc. any suggestions? I just want to > have > > the formated math expression as eps and I don't know how to do it, still > > after reading in the matplotlib-manual. > > > > > > /johannes > > > > > > > > >> > > >> Also, please send matplotlib questions just to the matplotlib list. > > >> Thanks. > > >> > > >> -- > > >> Robert Kern > > >> > > >> "I have come to believe that the whole world is an enigma, a harmless > > >> enigma that is made terrible by our own mad attempt to interpret it as > > >> though it had an underlying truth." > > >> -- Umberto Eco > > >> > > >> > > > ------------------------------------------------------------------------------ > > >> Achieve unprecedented app performance and reliability > > >> What every C/C++ and Fortran developer should know. > > >> Learn how Intel has extended the reach of its next-generation tools > > >> to help boost performance applications - inlcuding clusters. > > >> http://p.sf.net/sfu/intel-dev2devmay > > >> _______________________________________________ > > >> Matplotlib-users mailing list > > >> Mat...@li... > > >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > -- > > > NEU: FreePhone - kostenlos mobil telefonieren und surfen! > > > Jetzt informieren: http://www.gmx.net/de/go/freephone > > > _______________________________________________ > > > SciPy-User mailing list > > > Sci...@sc... > > > http://mail.scipy.org/mailman/listinfo/scipy-user > > > > > > > We have added a new feature to do just that in the development branch, > > but it should be fairly trivial to do with existing releases of > > matplotlib. Just create a figure object and use its figtitle to hold > > the expression and then save the figure. > > It might be trivial but how to remove the axis/plot then and crop the > extend of the eps? > > I tried: > > plt.figure() > plt.title(r'$F(x)=p*\frac{1}{s1\sqrt{2\pi}}*e^{-\frac{1}{2}*(\frac{x-m}{s1})}+(1-p)*\frac{1}{s1\sqrt{2\pi}}*e^{-\frac{1}{2}*(\frac{x-m}{s1})}$', > fontsize=20) > plt.show() > > /j > > Use figtext instead. I did the following and it looked fine to me: plt.figure() plt.figtext(0.1, 0.5, r'$F(x)=p*\frac{1}{s1\sqrt{2\pi}}*e^{-\frac{1}{2}*(\frac{x-m}{s1})}+(1-p)*\frac{1}{s1\sqrt{2\pi}}*e^{-\frac{1}{2}*(\frac{x-m}{s1})}$', fontsize=20) plt.show() I hope that helps! Ben Root |