John Hunter wrote:
> Option 1 is to educate them, and require them to \$
> quote that symbol. Option 2 is to enable a text property eg mathtext,
> and do
>
> text(x, y, 'what is the $\sin(x)$', mathtext=True)
>
Except for the backward incompatibility, I like this because it is explicit.
> Option 3 is to try and be clever, and interpret an even number of
> unquoted dollar symbols as mathtext, or any string that has a quoted
> dollar sign symbol as mathtext, else assume plain text.
That's close to what it does at the moment.
> Option 4 is
> to treat *all* strings as mathtext, but I think we would pay a pretty
> big performance hit to invoke the mathtext machinery for every piece
> of text. But it is an option.
I'm not sure the performance hit would be so bad. The parser is
completely flat until it goes between the $'s. But it would require all
$'s to be escaped, of course.
> In option 4, of course, users would be
> required to quote all dollar signs, so it is related to option 1 but
> slightly different in how it treats strings with no dollar signs.
>
> I'm not too keen on the text(x, y, Math('string')) proposal, which is
> a little outside the normal matplotlib approach.
>
> Michael, do you have a preference or an alternate proposal?
>
Well, that certainly is no shortage of options! ;) I think the decision
should ultimately lie with someone with a better sense of the existing
"feel" of matplotlib than I.
If we go with another delimiter, there are others in TeX to choose
from. Plain TeX uses $$ for display math, and LaTeX uses \[, \]. Both
of these are less likely to be legitimate literals. While display math
normally implies that the math is placed on a separate line (not inline
with the text), it's not far from what matplotlib does, since it follows
the display math layout patterns.
Cheers,
Mike
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel