python - How to align subscript and superscript with matplotlib? -
i'd put text r'$x=1_{-1}^{+1}$' matplotlib. used following code in ipython --pylab!:
text(0.1, 0.1, r'$1_{-1}^{+1}$', size=100)
in result, subscript , superscript not aligned, subscript slants little left compared superscript.
when use normal latex (or, example, latexit), not have problem, , expect matplotlib.
are there ways correct offset?
matplotlib
has 2 ways set mathtext: it's own internal engine or via external latex call. internal engine has advantage there , work, has limitations , and not complete implementation of latex. external calls give rendering full latex install, requires have latex installed, not given, , errors aren't handled super well.
to enable type setting via external call latex set
rcparams['text.usetex'] = true
or add
text.usetex: true
to matplotlibrc
file.
Comments
Post a Comment