---------------------------------------------------------------------------
ParseFatalException Traceback (most recent call last)
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/mathtext.py in parse(self, s, fonts_object, fontsize, dpi)
2516 try:
-> 2517 result = self._expression.parseString(s)
2518 except ParseBaseException as err:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in parseString(self, instring, parseAll)
1215 # catch and re-raise exception from here, clears out pyparsing internal stack trace
-> 1216 raise exc
1217 else:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in parseString(self, instring, parseAll)
1205 try:
-> 1206 loc, tokens = self._parse( instring, 0 )
1207 if parseAll:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseCache(self, instring, loc, doActions, callPreParse)
1136 try:
-> 1137 value = self._parseNoCache( instring, loc, doActions, callPreParse )
1138 ParserElement._exprArgCache[ lookup ] = (value[0],value[1].copy())
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseNoCache(self, instring, loc, doActions, callPreParse)
1071 try:
-> 1072 loc,tokens = self.parseImpl( instring, preloc, doActions )
1073 except IndexError:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in parseImpl(self, instring, loc, doActions)
2800 if self.expr is not None:
-> 2801 return self.expr._parse( instring, loc, doActions, callPreParse=False )
2802 else:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseCache(self, instring, loc, doActions, callPreParse)
1136 try:
-> 1137 value = self._parseNoCache( instring, loc, doActions, callPreParse )
1138 ParserElement._exprArgCache[ lookup ] = (value[0],value[1].copy())
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseNoCache(self, instring, loc, doActions, callPreParse)
1071 try:
-> 1072 loc,tokens = self.parseImpl( instring, preloc, doActions )
1073 except IndexError:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in parseImpl(self, instring, loc, doActions)
2543 else:
-> 2544 loc, exprtokens = e._parse( instring, loc, doActions )
2545 if exprtokens or exprtokens.haskeys():
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseCache(self, instring, loc, doActions, callPreParse)
1136 try:
-> 1137 value = self._parseNoCache( instring, loc, doActions, callPreParse )
1138 ParserElement._exprArgCache[ lookup ] = (value[0],value[1].copy())
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseNoCache(self, instring, loc, doActions, callPreParse)
1071 try:
-> 1072 loc,tokens = self.parseImpl( instring, preloc, doActions )
1073 except IndexError:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in parseImpl(self, instring, loc, doActions)
2969 try:
-> 2970 return super(ZeroOrMore, self).parseImpl(instring, loc, doActions)
2971 except (ParseException,IndexError):
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in parseImpl(self, instring, loc, doActions)
2922 try_not_ender(instring, loc)
-> 2923 loc, tokens = self_expr_parse( instring, loc, doActions, callPreParse=False )
2924 try:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseCache(self, instring, loc, doActions, callPreParse)
1136 try:
-> 1137 value = self._parseNoCache( instring, loc, doActions, callPreParse )
1138 ParserElement._exprArgCache[ lookup ] = (value[0],value[1].copy())
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseNoCache(self, instring, loc, doActions, callPreParse)
1071 try:
-> 1072 loc,tokens = self.parseImpl( instring, preloc, doActions )
1073 except IndexError:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in parseImpl(self, instring, loc, doActions)
2526 # pre-parsed the string as part of our And pre-parsing
-> 2527 loc, resultlist = self.exprs[0]._parse( instring, loc, doActions, callPreParse=False )
2528 errorStop = False
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseCache(self, instring, loc, doActions, callPreParse)
1136 try:
-> 1137 value = self._parseNoCache( instring, loc, doActions, callPreParse )
1138 ParserElement._exprArgCache[ lookup ] = (value[0],value[1].copy())
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseNoCache(self, instring, loc, doActions, callPreParse)
1097 for fn in self.parseAction:
-> 1098 tokens = fn( instring, tokensStart, retTokens )
1099 if tokens is not None:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in wrapper(*args)
818 try:
--> 819 ret = func(*args[limit[0]:])
820 foundArity[0] = True
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/mathtext.py in math_string(self, s, loc, toks)
2587 # print "math_string", toks[0][1:-1]
-> 2588 return self._math_expression.parseString(toks[0][1:-1])
2589
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in parseString(self, instring, parseAll)
1215 # catch and re-raise exception from here, clears out pyparsing internal stack trace
-> 1216 raise exc
1217 else:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in parseString(self, instring, parseAll)
1205 try:
-> 1206 loc, tokens = self._parse( instring, 0 )
1207 if parseAll:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseCache(self, instring, loc, doActions, callPreParse)
1136 try:
-> 1137 value = self._parseNoCache( instring, loc, doActions, callPreParse )
1138 ParserElement._exprArgCache[ lookup ] = (value[0],value[1].copy())
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseNoCache(self, instring, loc, doActions, callPreParse)
1071 try:
-> 1072 loc,tokens = self.parseImpl( instring, preloc, doActions )
1073 except IndexError:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in parseImpl(self, instring, loc, doActions)
2800 if self.expr is not None:
-> 2801 return self.expr._parse( instring, loc, doActions, callPreParse=False )
2802 else:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseCache(self, instring, loc, doActions, callPreParse)
1136 try:
-> 1137 value = self._parseNoCache( instring, loc, doActions, callPreParse )
1138 ParserElement._exprArgCache[ lookup ] = (value[0],value[1].copy())
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseNoCache(self, instring, loc, doActions, callPreParse)
1071 try:
-> 1072 loc,tokens = self.parseImpl( instring, preloc, doActions )
1073 except IndexError:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in parseImpl(self, instring, loc, doActions)
2922 try_not_ender(instring, loc)
-> 2923 loc, tokens = self_expr_parse( instring, loc, doActions, callPreParse=False )
2924 try:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseCache(self, instring, loc, doActions, callPreParse)
1136 try:
-> 1137 value = self._parseNoCache( instring, loc, doActions, callPreParse )
1138 ParserElement._exprArgCache[ lookup ] = (value[0],value[1].copy())
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseNoCache(self, instring, loc, doActions, callPreParse)
1071 try:
-> 1072 loc,tokens = self.parseImpl( instring, preloc, doActions )
1073 except IndexError:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in parseImpl(self, instring, loc, doActions)
2800 if self.expr is not None:
-> 2801 return self.expr._parse( instring, loc, doActions, callPreParse=False )
2802 else:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseCache(self, instring, loc, doActions, callPreParse)
1136 try:
-> 1137 value = self._parseNoCache( instring, loc, doActions, callPreParse )
1138 ParserElement._exprArgCache[ lookup ] = (value[0],value[1].copy())
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseNoCache(self, instring, loc, doActions, callPreParse)
1071 try:
-> 1072 loc,tokens = self.parseImpl( instring, preloc, doActions )
1073 except IndexError:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in parseImpl(self, instring, loc, doActions)
2657 try:
-> 2658 ret = e._parse( instring, loc, doActions )
2659 return ret
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseCache(self, instring, loc, doActions, callPreParse)
1136 try:
-> 1137 value = self._parseNoCache( instring, loc, doActions, callPreParse )
1138 ParserElement._exprArgCache[ lookup ] = (value[0],value[1].copy())
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in _parseNoCache(self, instring, loc, doActions, callPreParse)
1097 for fn in self.parseAction:
-> 1098 tokens = fn( instring, tokensStart, retTokens )
1099 if tokens is not None:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/pyparsing.py in wrapper(*args)
818 try:
--> 819 ret = func(*args[limit[0]:])
820 foundArity[0] = True
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/mathtext.py in unknown_symbol(self, s, loc, toks)
2693 c = toks[0]
-> 2694 raise ParseFatalException(s, loc, "Unknown symbol: %s" % c)
2695
ParseFatalException: Unknown symbol: \displaystyle (at char 0), (line:1, col:1)
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
<ipython-input-4-67f57575cd9e> in <module>()
19 plt.subplots_adjust(top=0.8)
20
---> 21 plt.savefig('tex_demo')
22 plt.show()
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/pyplot.py in savefig(*args, **kwargs)
695 def savefig(*args, **kwargs):
696 fig = gcf()
--> 697 res = fig.savefig(*args, **kwargs)
698 fig.canvas.draw_idle() # need this if 'transparent=True' to reset colors
699 return res
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/figure.py in savefig(self, *args, **kwargs)
1570 self.set_frameon(frameon)
1571
-> 1572 self.canvas.print_figure(*args, **kwargs)
1573
1574 if frameon:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, **kwargs)
2242 orientation=orientation,
2243 bbox_inches_restore=_bbox_inches_restore,
-> 2244 **kwargs)
2245 finally:
2246 if bbox_inches and restore_bbox:
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py in print_png(self, filename_or_obj, *args, **kwargs)
543
544 def print_png(self, filename_or_obj, *args, **kwargs):
--> 545 FigureCanvasAgg.draw(self)
546 renderer = self.get_renderer()
547 original_dpi = renderer.dpi
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py in draw(self)
462
463 try:
--> 464 self.figure.draw(self.renderer)
465 finally:
466 RendererAgg.lock.release()
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
61 def draw_wrapper(artist, renderer, *args, **kwargs):
62 before(artist, renderer)
---> 63 draw(artist, renderer, *args, **kwargs)
64 after(artist, renderer)
65
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/figure.py in draw(self, renderer)
1141
1142 mimage._draw_list_compositing_images(
-> 1143 renderer, self, dsu, self.suppressComposite)
1144
1145 renderer.close_group('figure')
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/image.py in _draw_list_compositing_images(renderer, parent, dsu, suppress_composite)
137 if not_composite or not has_images:
138 for zorder, a in dsu:
--> 139 a.draw(renderer)
140 else:
141 # Composite any adjacent images together
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
61 def draw_wrapper(artist, renderer, *args, **kwargs):
62 before(artist, renderer)
---> 63 draw(artist, renderer, *args, **kwargs)
64 after(artist, renderer)
65
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/axes/_base.py in draw(self, renderer, inframe)
2407 renderer.stop_rasterizing()
2408
-> 2409 mimage._draw_list_compositing_images(renderer, self, dsu)
2410
2411 renderer.close_group('axes')
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/image.py in _draw_list_compositing_images(renderer, parent, dsu, suppress_composite)
137 if not_composite or not has_images:
138 for zorder, a in dsu:
--> 139 a.draw(renderer)
140 else:
141 # Composite any adjacent images together
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/artist.py in draw_wrapper(artist, renderer, *args, **kwargs)
61 def draw_wrapper(artist, renderer, *args, **kwargs):
62 before(artist, renderer)
---> 63 draw(artist, renderer, *args, **kwargs)
64 after(artist, renderer)
65
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/text.py in draw(self, renderer)
800 textrenderer.draw_text(gc, x, y, clean_line,
801 textobj._fontproperties, angle,
--> 802 ismath=ismath, mtext=mtext)
803
804 gc.restore()
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py in draw_text(self, gc, x, y, s, prop, angle, ismath, mtext)
188
189 if ismath:
--> 190 return self.draw_mathtext(gc, x, y, s, prop, angle)
191
192 flags = get_hinting_flag()
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/backends/backend_agg.py in draw_mathtext(self, gc, x, y, s, prop, angle)
173 'debug-annoying')
174 ox, oy, width, height, descent, font_image, used_characters = \
--> 175 self.mathtext_parser.parse(s, self.dpi, prop)
176
177 xd = descent * sin(radians(angle))
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/mathtext.py in parse(self, s, dpi, prop)
3287 self.__class__._parser = Parser()
3288
-> 3289 box = self._parser.parse(s, font_output, fontsize, dpi)
3290 font_output.set_canvas_size(box.width, box.height, box.depth)
3291 result = font_output.get_results(box)
/home/lindsayad/miniconda3/lib/python3.6/site-packages/matplotlib/mathtext.py in parse(self, s, fonts_object, fontsize, dpi)
2521 err.line,
2522 " " * (err.column - 1) + "^",
-> 2523 six.text_type(err)]))
2524 self._state_stack = None
2525 self._em_width_cache = {}
ValueError:
\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}
^
Unknown symbol: \displaystyle (at char 0), (line:1, col:1)