Skip to content

\right) becomes ! when used together with sumation in latex strings #12834

Closed as duplicate

Description

@juergspaak

the string
r"$\left( \sum_{i=1}^n \right)$"
is not formated properly by matplotlib axis labeling (or plt.text either).
The last symbol should be a big ")", however is a "!". The problem seems to be caused by \sum_{i=1}^n, as it does not occur in other combinations. (see script below).

here's code for reproduction
import matplotlib.pyplot as plt

plt.plot(range(5))
plt.xlabel(r"$\left( \sum_{i=1}^n \right)$", fontsize = 16)
plt.ylabel(r"$\left( 100 \right)\left(\sum_{i=1}^n\right]$", fontsize = 16)

Here's the output of the above code.
bugreport.pdf

The y-axis is formated correctly, not however the x-axis (! should be a ).

Matplotlib version

  • Operating system: Windows
  • Matplotlib version: 1.5.3
  • Matplotlib backend : module://ipykernel.pylab.backend_inline
  • Python version: '3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul 5 2016, 11:41:13) [MSC v.1900 64 bit (AMD64)]'

matplotlib was installed via conda

Activity

  1. QuLogic commented on Nov 19, 2018

    @QuLogic
    Member

    I cannot reproduce this with Matplotlib 2.2.3; can you try updating?

  2. juergspaak commented on Nov 19, 2018

    @juergspaak
    Author

    updated and works fine, thanks

  3. QuLogic commented on Sep 4, 2025

    @QuLogic
    Member

    This is actually a duplicate of #5210 and was only "fixed" by the change of default font.

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

Metadata

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