简体   繁体   中英

writing greek letters with subscripts with matplotlib

I have to use greek letter with subscript as axes label, so i thought to use Latex symbols. I am using the following code:

from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
rc('text', usetex=True)

and in the plot I have, for example:

ylabel(r'$\boldsymbol{\delta_y}$')

It works fine, it is just slow (it take about 5 sec. to make a plot), I guess it is bacause python has to call an external package.

Any chances I can make it faster?

I am using python 2.6

Try using rc('text', usetex=False) .

With this matplotlib will use the internal mathtext instead of your OS's latex installation to render math symbols. See the docs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM