Why \wedge works but \vee does not?

56 views
Skip to first unread message

Jori Mäntysalo

unread,
May 25, 2015, 4:48:30 AM5/25/15
to sage-...@googlegroups.com
Strange:

L=LatticePoset({0:['A', 'x', 'B'], 'A': ['y'], 'x': ['y', 'C'], 'B': ['C'], 'y': [1], 'C': [1]})
L.show(figsize=3, vertex_colors={'gray': [0,1,'x', 'y'], '#ff0000': ['A'], '#00ff00': ['B', 'C']}, title="$A \wedge B=1$ and $A \vee B=0$.")

It seems that \wedge works, but \vee does not. Already documented bug?

--
Jori Mäntysalo

Volker Braun

unread,
May 25, 2015, 5:37:00 AM5/25/15
to sage-...@googlegroups.com
Looks like a bug in matplotlib's internal TeX processor. It does understand e.g. \curlyvee which, one would have thought, is more obscure.

Jori Mäntysalo

unread,
May 25, 2015, 8:02:05 AM5/25/15
to sage-...@googlegroups.com
On Mon, 25 May 2015, Volker Braun wrote:

> Looks like a bug in matplotlib's internal TeX processor. It does understand
> e.g. \curlyvee which, one would have thought, is more obscure. 

OK. Somebody wants to open ticket for them?

At least this works with newest version available for Fedora 21, so it not
just missing font (or has been corrected):

import numpy as np
from matplotlib.pyplot import figure, show
fig = figure()
ax = fig.add_subplot(111, axisbg='y')
ax.set_title(r'$A \wedge B \vee C$')
show()

--
Jori Mäntysalo

John H Palmieri

unread,
May 25, 2015, 11:41:42 AM5/25/15
to sage-...@googlegroups.com
For me, it works using a raw string:

    title=r"$A \wedge B=1$ and $A \vee B=0$".

Have you tried that? (I don't know if it's a bug: I think it's always safer to use raw strings when the strings contain backslashes.)

  John

Jori Mäntysalo

unread,
May 25, 2015, 12:51:25 PM5/25/15
to sage-...@googlegroups.com
On Mon, 25 May 2015, John H Palmieri wrote:

> For me, it works using a raw string:
>
>     title=r"$A \wedge B=1$ and $A \vee B=0$".

Thanks, it works! (Of course... I stupid.)

--
Jori Mäntysalo

john_perry_usm

unread,
May 26, 2015, 6:04:48 AM5/26/15
to sage-...@googlegroups.com
It's not a bug. The backslash is used in string formatting: \v has some meaning, while \w does not. See http://pythonweb.org/projects/webmodules/doc/0.5.3/html_multipage/lib/node48.html

Unfortunately, the backslash is also used in LaTeX formatting. I discovered a long time ago that it's best to pass Latex in strings with double backslash, for instance, \\vee.

I guess the raw string thing works, too.

john perry
Reply all
Reply to author
Forward
0 new messages