Am Freitag, 29. Januar 2010 21:00:04 schrieb Sebastian Busch:
> Florian Lindner wrote:
> > Hello,
> > 
> > I try to use LaTeX in my plot....
> > 
> > flor...@horus:~> cat .matplotlib/matplotlibrc
> > text.usetex        : true
> > 
> > My plotting code looks like:
> > 
> > Ma = arange(1.0, 5.0, 0.01)
> > Ts = [T(i) for i in Ma]  # BTW: Is there a way to spare this line?
> not sure what T is. you could try T(Ma); you can do that of course also
> directly in the plot command

T is a python function:

def T(Ma):
    fp = fluidproperties.IdealGas()
    fp.Ma = Ma
    return NormalShock(fp).fp_out().T / fp.

plot(Ma, T(Ma), label=r'$\frac{T2}{T1}$') does not work. The plot window 
appears, but no plot.

> > plot(Ma, Ts, label=r'/frac{T2}{T1}')
> should be backslash and math mode:

> plot(Ma, Ts, label=r'$\frac{T2}{T1}$')
> legend()
> show()
> 
> > and that's all, no plot window appears, the script is finished.
> 
> you did not show() !

Actually I did it. I stripped the code before pasting it here, my fault. But 
not it works, thanks!

Florian

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to