In matplotlib 0.90.1, the trigger to render the string with math 
formatting is if the string that is ultimately passed to the plotting 
engine starts and ends with a '$'.

So to get your expression to work, you would need to do something like:

    vlostring="$v_{lo}=%5.2f$" % (vlo)

Does that work for you?

Cheers,
Mike

David D Clark wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello,
> 
> I am trying to create some text on a plot with the following commands:
> 
> vlostring="$v_{lo}$="+str(vlo)+" t="+str(vlotime)
> text(vlo,vlotime,vlostring)
> 
> However, the text is rendered literally --
> 
> $v_{lo}$=0.3 t=7961.66
> 
> instead of nicely formatted LaTeX like text
> 
> when I do
> 
> text(vlo,vlotime,"$v_{lo}=$")
> 
> without trying to add the str(...), it renders the expression correctly.
> 
> Any suggestions?
> Dave
> 
> - --
> David D. Clark
> Electrical Engineer
> P-23, Neutron Science and Technology
> e-mail mailto:[EMAIL PROTECTED]
> GPG Public key 0x018D6523 available at http://www.us.pgp.net
> http://www.gnupg.org has information about public key cryptography
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
> 
> iD8DBQFGwgG0Nu7GcwGNZSMRAqRrAJ4kHL6bpFVFhJteHQ1uzQPtREFxkwCdFxe4
> zw3F6ymJr5XSeJxwDQmBFjE=
> =MIQ6
> -----END PGP SIGNATURE-----
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to