Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
This bug report originates from my attempts toanswer this question on Stack Overflow. Minimal example thanks to theother answer there by Baptiste.
With certain LaTeX strings, the right paranthesis indicates by\right)
is replaced with an exclamation point when passed to MathTextParser and rendered as a bitmap or png. This behaviour appears to occur when the parantheses are around an expression comprising multiple layered fractions. It does not occur if\right]
or\right\}
are used
The minimal code to reproduce this is as follows:
import matplotlib.mathtext as mts = r'$\left(\frac{\frac{\frac{M}{I}}{N}}' \ r'{\frac{\frac{B}{U}}{G}}\right)$'parser = mt.MathTextParser("Bitmap")for size in range(1, 30): filename = "figure{0}.png".format(size) parser.to_png(filename, s, fontsize=size)
This gives output like
Investigations indicate that this occurs only for certain combinations of expression and font size, but the example given above seems to give the most consistent failure conditions. Itmay be related todpi
in the rendering, however this has not yet been conclusively proven or disproven.