TeX $\times$ symbol not working in matplotlib?

Peter Otten __peter__ at web.de
Fri Apr 18 13:04:17 EDT 2014


gwhite wrote:

> plt.title(' '.join([r'$\mathrm{poles}$', r'$(\times)$',\
>                     r'$\mathrm{\&}$', r'$\mathrm{zeros}$',
>                     r'$(\circ)$',  r'$\mathrm{of}$',\
>                     r'$T(s)T(-s)$']), fontsize=16)

Note that adjacent string literals on the same line or inside parentheses 
are automatically concatenated by the compiler. So you may write the above 
as

plt.title(
    r'$\mathrm{poles}$ $(\times)$ '
    r'$\mathrm{\&}$ $\mathrm{zeros}$ '
    r'$(\circ)$ $\mathrm{of}$ $T(s)T(-s)$',
    fontsize=16)

Even if you leave everything else as is you don't need any backslashes at 
the end of the line.




More information about the Python-list mailing list