Skip to content

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

@yves-surrel

Description

@yves-surrel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions