On Sun, Jan 31, 2010 at 4:21 PM, per freem <perfreem@gmail.com> wrote:
hi all,

two quick questions about labels. first, is there a way to make
subscripts/superscripts *without* using TeX in labels? For example, I
use helvetica in all my labels and I want to plot something like:
plt.xlabel("log10") where "10" is a subscript of "log", but without
doing: plt.xlabel(r"$\log_{10}$"), since that will use LaTeX fonts
instead of my helvetica font.

Unicode strings might be the answer for this. Though needs someone's confirmation.
 

second question, when using TeX, I tried the following TeX command in labels:
plt.annotate(r"\frac{\sigma}{\sqrt{\mu}}", ....) but it complains that
"not all arguments converted during string formatting" -- but it seems
like correct TeX to me. if I try r"\frac{1}{2}" then it works, but
using \sigma and \sqrt inside breaks it.. any idea how to fix this?

Have you forgotten "$" ? The following works correctly in my system.

plt.xlabel(r"$\frac{\sigma}{\sqrt{\mu}}$")
 

thanks.

------------------------------------------------------------------------------
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



--
Gökhan