On Tue, Nov 23, 2010 at 8:15 PM, Nicolas Bigaouette
wrote:
> Why not just use latex?
> plt.text(0.05, 0.95, r"This is the square marker: $\Box$ Subscript: $_\Box$
> superscript: $^\Box$", fontsize=20)
It produces the following error:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__
return self.func(*args)
File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py",
line 212, in resize
self.show()
File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py",
line 215, in draw
FigureCanvasAgg.draw(self)
File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py",
line 314, in draw
self.figure.draw(self.renderer)
File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46,
in draw_wrapper
draw(artist, renderer, *kl)
File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 773, in draw
for a in self.axes: a.draw(renderer)
File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46,
in draw_wrapper
draw(artist, renderer, *kl)
File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1735, in draw
a.draw(renderer)
File "/usr/lib/pymodules/python2.6/matplotlib/text.py", line 515, in draw
bbox, info = self._get_layout(renderer)
File "/usr/lib/pymodules/python2.6/matplotlib/text.py", line 279, in
_get_layout
clean_line, self._fontproperties, ismath=ismath)
File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py",
line 156, in get_text_width_height_descent
self.mathtext_parser.parse(s, self.dpi, prop)
File "/usr/lib/pymodules/python2.6/matplotlib/mathtext.py", line
2810, in parse
box = self._parser.parse(s, font_output, fontsize, dpi)
File "/usr/lib/pymodules/python2.6/matplotlib/mathtext.py", line
2259, in parse
self._expression.parseString(s)
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
1048, in parseString
loc, tokens = self._parse( instring, 0 )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
981, in _parseCache
value = self._parseNoCache( instring, loc, doActions, callPreParse )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
924, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
2559, in parseImpl
return self.expr._parse( instring, loc, doActions, callPreParse=False )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
981, in _parseCache
value = self._parseNoCache( instring, loc, doActions, callPreParse )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
924, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
2307, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
981, in _parseCache
value = self._parseNoCache( instring, loc, doActions, callPreParse )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
924, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
2672, in parseImpl
loc, tokens = self.expr._parse( instring, loc, doActions,
callPreParse=False )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
981, in _parseCache
value = self._parseNoCache( instring, loc, doActions, callPreParse )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
924, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
2307, in parseImpl
loc, exprtokens = e._parse( instring, loc, doActions )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
981, in _parseCache
value = self._parseNoCache( instring, loc, doActions, callPreParse )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
924, in _parseNoCache
loc,tokens = self.parseImpl( instring, preloc, doActions )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
2416, in parseImpl
ret = e._parse( instring, loc, doActions )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
981, in _parseCache
value = self._parseNoCache( instring, loc, doActions, callPreParse )
File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line
950, in _parseNoCache
tokens = fn( instring, tokensStart, retTokens )
File "/usr/lib/pymodules/python2.6/matplotlib/mathtext.py", line
1997, in raise_error
raise ParseFatalException(msg + "\n" + s)
ParseFatalException: Expected end of math '$'
This is the square marker: $\Box$ Subscript (at char 0), (line:1, col:1)
--