X Tutup
Skip to content

Subscript/superscript sequence is too long with $\left. X \right|$ #7615

@dinya

Description

@dinya

I want to label my curve with $\left. \frac{f(w)}{g(o)}\right|_{o=2}^{w=1}$ to prettify vertical line (like http://mathb.in/111947).

But code

from matplotlib import pylab as plt
plt.plot([1,2,3], [1,3,7], label=ur"$\left. \frac{f(w)}{g(o)}\right|_{o=2}^{w=1}$")
plt.legend()
plt.show()

raises

...
ValueError: 

^
Subscript/superscript sequence is too long. Use braces { } to remove ambiguity. (at char 0), (line:1, col:1)

Code

from matplotlib import pylab as plt
plt.plot([1,2,3], [1,3,7], label=ur"$\frac{f(w)}{g(o)}|_{o=2}^{w=1}$")
plt.legend()
plt.show()

works, but vertical line is not maximized.

Used versions:

python: 2.7.12.final.0 (installed with miniconda2)
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None

pip: 8.1.2
numpy: 1.11.2
scipy: 0.18.1
IPython: 5.1.0
matplotlib: 1.5.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Hardhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuestopic: text

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup