python - Matplotlib: Change math font size -
i making plots matplotlib, , i've come across problem tex rendering. seems mathtext x-height is bit smaller normal bitstream vera sans. see following example:
x = linspace(0, 30, 300); y = 0.5*rand(300)+20/(numpy.power(x-15, 2)+4); xlabel(r'$\omega$ (rad$\cdot$hz)'); ylabel(r'intensity$^2$'); title(r'why $mathtext$ smaller normal text?');
as can see, it's particularly noticeable greek letters , numbers. ideally, i'd able define scaling factor make math text bit bigger @ each font size. there way simply? not want use computer modern everywhere. not want compile new tex math font, if that's possible.
one solution would on board using sans-serif fonts greek letters , numerals, whatever reason, matplotlib ignores formatting on those:
title('why $mat\mathsf{plot}lib$ ignore formatting $\mathsf{2}$ ($\mathsf{two}), $\mathbf{2}$ ($\mathbf{two}) , $\mathsf{\omega}$?')
i assume it's nature of how these things typeset, there way fix it?
from matplotlib docs:
additionally, can use
\mathdefault{...}
or alias\mathregular{...}
use font used regular text outside of mathtext. there number of limitations approach, notably far fewer symbols available, can useful make math expressions blend other text in plot.
Comments
Post a Comment