Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: Inconsistent rendering between backends when rendering Mathtext horizontal rule #23763

Open
@tfpf

Description

@tfpf

Bug summary

When the last item in a MathtextVlist is anHrule, the AGG and SVG backends render the image differently. The difference is not obvious at small font sizes.

To see this happen, we have to dive into Mathtext internals. An easy way is to modify fractions to end with the horizontal rule.

Code for reproduction

importmatplotlib.pyplotaspltimportmatplotlib._mathtextas_mathtextplt.rcdefaults()def_genfrac(self,ldelim,rdelim,rule,style,num,den):state=self.get_state()thickness=state.get_current_underline_thickness()vlist=_mathtext.Vlist([num,_mathtext.Vbox(0,2*thickness),_mathtext.Hrule(state,thickness)])return [_mathtext.Hlist([vlist])]_mathtext.Parser._genfrac=_genfrac(fig,ax)=plt.subplots()plt.text(.5,.3,r'$\dfrac{up}{down}$',size=100,ha='center',va='baseline')plt.axhline(.3)plt.savefig('Hrule_at_bottom.png')plt.savefig('Hrule_at_bottom.svg')plt.show()

Actual outcome

Hrule_at_bottom
PNG output

Hrule_at_bottom
SVG output

Expected outcome

Both images should be identical.

Additional information

Why does it matter if it's related to a private module in Matplotlib?

This is one of the things holding up#23616.Vlists ending with anHrule are not being positioned correctly.

Operating system

Ubuntu 20.04 LTS Focal Fossa on WSL

Matplotlib Version

3.5.0.dev5855+gee2f68bdc9

Matplotlib Backend

WXAgg

Python version

Python 3.8.10

Jupyter version

6.0.3

Installation

git checkout

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp