🌐 AI搜索 & 代理 主页
Skip to content

Math text bounding box incorrect #20623

@QuLogic

Description

@QuLogic

Bug report

Bug summary

I noticed this in the mathtext tutorial after #20605. The text in the accent section is cut off, so that the triple dot and quadruple dot accent appear to be the same.

Code for reproduction

from matplotlib.font_manager import FontProperties
from matplotlib.mathtext import math_to_image

pstra = [r'$\dot{x}$', r'$\ddot{x}$', r'$\dddot{x}$', r'$\ddddot{x}$']

for i, text in enumerate(pstra):
    math_to_image(text, f'text{i}.png', prop=FontProperties(size=50), dpi=100)

Actual outcome

text0
text1
text2
text3

In fact, looking at it closely, I think the x may be cut off in the top right as well. It should come to a point, I believe, not a corner.

Expected outcome

The last image should have 4 dots above the x.

Matplotlib version

  • Operating system: Fedora 34
  • Matplotlib version (import matplotlib; print(matplotlib.__version__)): 0dd603f
  • Matplotlib backend (print(matplotlib.get_backend())): N/A
  • Python version: 3.7.6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions