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

Matplotlib cannot parse TeX with \text command #18520

Closed
@sindzicat

Description

@sindzicat

Hello!

Minimal example:

importmatplotlibaspltfig,ax=plt.subplots()ax.text(0,0,r'$s_\text{ind}$')

Result:

ValueError: s_\text{ind}    ^Expected {accentprefixed | accent | symbol | c_over_c | function | group | frac | dfrac | stackrel | binom | genfrac | sqrt | overline | operatorname}, found 'e'  (at char 4), (line:1, col:5)

As far as I remember,r means raw string, so\t mustn't interpreter as tab. I tried\\t and other ways to avoid this problem but I didn't find any workaround for this case yet... So it seems to me I found a bug.

I use Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)],
Matplotlib version is 3.3.1. I tried my code in JupyterLab ver. 2.2.7 on Windows 10.
Matplotlib backend ismodule://ipykernel.pylab.backend_inline.

Best regards,
Sindzicat.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp