Skip to content

LaTeX text rendering is broken for Maplotlib version > 3.5.0 #8

Open
@yves-surrel

Description

Thank you for maintaining Matplotlib garden flower!

Rendering LateX text (as in axes.text(0.5, 0.9, '$\sigma$')) is broken with MatplotLib > 3.5.0:

File ~/mambaforge/lib/python3.9/site-packages/kivy_garden/matplotlib/backend_kivy.py:871 in get_text_width_height_descent
    ftimage, depth = self.mathtext_parser.parse(s, self.dpi, prop)

ValueError: too many values to unpack (expected 2)

This is due to the new behaviour of matplotlib.mathtext.MathTextParser.parse() (from the doc).

Depending on the output type, this returns either a VectorParse or a RasterParse

As in RendererKivy.__init__() the MathTextParseris created with the 'agg' output, a RasterParse (NamedTuple with more than 2 items) is returned.

Also, it seems that the LaTeX rendering has undergone many other changes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions