How do I get Helvetica font in math snippet in matplotlib? -
i want write $\eta=a^2$
in helvetica/arial matplotlib label. see 2 possibilities:
u"η${}=a^2$"
withmatplotlib.rc("font", **{"sans-serif": ["arial"], "size": fontsize})
u"$\\eta=a^2$"
withmatplotlib.rc("font", **{"sans-serif": ["arial"], "size": fontsize}) matplotlib.rc("text", usetex=true) matplotlib.rc("text.latex", preamble=["\\usepackage{helvet}\\usepackage{sfmath}"])
in first case, math has standard cm fonts. in second case, η in standard cm font. bummer. there way everything in helvetica/arial?
in first option, add following 'font' dictionary:
'style':'normal' 'family':'sans'
Comments
Post a Comment