Search code examples
matplotlibfontsmath-mode

Matplotlib: correct math font size


Math text in matplotlib is rendered smaller than the regular text as show by

ax.set_xlabel(r'Variable $\alpha$')

Further details on this problem are found in Matplotlib: Change math font size.

The accepted solution was setting math font to regular font. But then variable in math mode are not italic as they should be.

I need variables in math mode and of the same size as text.

How can this be achieved and why is this not the default?


Solution

  • I have reported this issue at https://github.com/matplotlib/matplotlib/issues/7778.

    There I learned that this is fixed in matplotlib 2.0.

    This got released and it works!

    See Changes to the default style.