Ask Your Question
0

Unrecognised TeX code (2)

asked 13 years ago

Dirk Danckaert gravatar image

Why is the following latex code correctly recognised by the view()-function (for outputting results) but not by the text()-function (for inclusion in a plot)?

Dy='$\\begin{align}\\Delta y&=y_2-y_1 \\\\ &=m\\cdot\\Delta x \\end{align}$'

view(Dy) gives a correctly formatted latex formula but text(Dy,...) returns an error message.

Preview: (hide)

Comments

1

As far as I know, the `text` command passes its arguments to matplotlib, so matplotlib handles any LaTeX code. Perhaps it doesn't understand the `align` environment?

John Palmieri gravatar imageJohn Palmieri ( 13 years ago )

That could well be the case. Would explain too why ':' (in latex code) is rendered as '.' in text(), but not in view().

Dirk Danckaert gravatar imageDirk Danckaert ( 13 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 13 years ago

Jason Grout gravatar image

John is right, I believe. Here is the documentation for mathtext (i.e., matplotlib's tex renderer). You could conceivably do the usetex option in matplotlib to have matplotlib pass the expression directly to Tex, which may make the align command work.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 13 years ago

Seen: 336 times

Last updated: Sep 20 '11