8000 Annotations with Latex code cause errors in 1.5 master · Issue #3641 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Annotations with Latex code cause errors in 1.5 master #3641
Closed
@tobias47n9e

Description

@tobias47n9e

I get several error messages when running the following 2 code-snippets using pyplot. My original intent was to plot an array or matrix in the annotations. I am using Mpl 1.5 from https://launchpad.net/~takluyver/+archive/ubuntu/matplotlib-daily

from matplotlib import rcParams

rcParams['text.usetex'] = True

ax.annotate(
    r"$ \begin{array}{ccc} a & b & c \\ d & e & f \\ g & h & i \end{array} $",
    (0.25, 0.25),
    textcoords='axes fraction', size=20)
/usr/lib/python3/dist-packages/matplotlib/text.py:1788: UserWarning: You have used the `textcoords` kwarg, but not the `xytext` kwarg.  This can lead to surprising results.
  warnings.warn("You have used the `textcoords` kwarg, but not "
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.4/tkinter/__init__.py", line 1490, in __call__
    return self.func(*args)
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_tkagg.py", line 278, in resize
    self.show()
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_tkagg.py", line 349, in draw
    FigureCanvasAgg.draw(self)
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_agg.py", line 469, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/figure.py", line 1079, in draw
    func(*args)
  File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 2092, in draw
    a.draw(renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/axis.py", line 1099, in draw
    renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/axis.py", line 1049, in _get_tick_bboxes
    extent = tick.label1.get_window_extent(renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/text.py", line 741, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/text.py", line 311, in _get_layout
    ismath=False)
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_agg.py", line 223, in get_text_width_height_descent
    renderer=self)
  File "/usr/lib/python3/dist-packages/matplotlib/texmanager.py", line 670, in get_text_width_height_descent
    dvifile = self.make_dvi(tex, fontsize)
  File "/usr/lib/python3/dist-packages/matplotlib/texmanager.py", line 417, in make_dvi
    report))
RuntimeError: LaTeX was not able to process the following string:
b'lp'
Here is the full report generated by LaTeX: 

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
 restricted \write18 enabled.
entering extended mode
(./c5383a18897d5b8dd569836a32b6a2df.tex
LaTeX2e <2011/06/27>
Babel <3.9h> and hyphenation patterns for 7 languages loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))

! LaTeX Error: File `type1cm.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 

l.3 \renewcommand
                 {\rmdefault}{pnc}^^M
No pages of output.
Transcript written on c5383a18897d5b8dd569836a32b6a2df.log.

Example 2:

rcParams['text.latex.preamble'] = r'\usepackage{amsmath}'

ax.annotate(
    r"$ \begin{matrix} a & b & c \\ d & e & f \\ g & h & i \end{matrix} $",
    (0.25, 0.25),
    textcoords='axes fraction', size=20)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_gtk3agg.py", line 42, in on_draw_event
    self._render_figure(w, h)
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_gtk3agg.py", line 32, in _render_figure
    backend_agg.FigureCanvasAgg.draw(self)
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_agg.py", line 469, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/figure.py", line 1079, in draw
    func(*args)
  File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 2092, in draw
    a.draw(renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/axis.py", line 1099, in draw
    renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/axis.py", line 1049, in _get_tick_bboxes
    extent = tick.label1.get_window_extent(renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/text.py", line 741, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/text.py", line 311, in _get_layout
    ismath=False)
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_agg.py", line 223, in get_text_width_height_descent
    renderer=self)
  File "/usr/lib/python3/dist-packages/matplotlib/texmanager.py", line 670, in get_text_width_height_descent
    dvifile = self.make_dvi(tex, fontsize)
  File "/usr/lib/python3/dist-packages/matplotlib/texmanager.py", line 417, in make_dvi
    report))
RuntimeError: LaTeX was not able to process the following string:
b'lp'
Here is the full report generated by LaTeX: 

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
 restricted \write18 enabled.
entering extended mode
(./c5383a18897d5b8dd569836a32b6a2df.tex
LaTeX2e <2011/06/27>
Babel <3.9h> and hyphenation patterns for 7 languages loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))

! LaTeX Error: File `type1cm.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 

l.3 \renewcommand
                 {\rmdefault}{pnc}^^M
No pages of output.
Transcript written on c5383a18897d5b8dd569836a32b6a2df.log.

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_gtk3agg.py", line 42, in on_draw_event
    self._render_figure(w, h)
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_gtk3agg.py", line 32, in _render_figure
    backend_agg.FigureCanvasAgg.draw(self)
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_agg.py", line 469, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/figure.py", line 1079, in draw
    func(*args)
  File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 2092, in draw
    a.draw(renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/axis.py", line 1099, in draw
    renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/axis.py", line 1049, in _get_tick_bboxes
    extent = tick.label1.get_window_extent(renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/text.py", line 741, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/text.py", line 311, in _get_layout
    ismath=False)
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_agg.py", line 223, in get_text_width_height_descent
    renderer=self)
  File "/usr/lib/python3/dist-packages/matplotlib/texmanager.py", line 670, in get_text_width_height_descent
    dvifile = self.make_dvi(tex, fontsize)
  File "/usr/lib/python3/dist-packages/matplotlib/texmanager.py", line 417, in make_dvi
    report))
RuntimeError: LaTeX was not able to process the following string:
b'lp'
Here is the full report generated by LaTeX: 

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
 restricted \write18 enabled.
entering extended mode
(./c5383a18897d5b8dd569836a32b6a2df.tex
LaTeX2e <2011/06/27>
Babel <3.9h> and hyphenation patterns for 7 languages loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))

! LaTeX Error: File `type1cm.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 

l.3 \renewcommand
                 {\rmdefault}{pnc}^^M
No pages of output.
Transcript written on c5383a18897d5b8dd569836a32b6a2df.log.

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_gtk3agg.py", line 42, in on_draw_event
    self._render_figure(w, h)
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_gtk3agg.py", line 32, in _render_figure
    backend_agg.FigureCanvasAgg.draw(self)
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_agg.py", line 469, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/figure.py", line 1079, in draw
    func(*args)
  File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 2092, in draw
    a.draw(renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/axis.py", line 1099, in draw
    renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/axis.py", line 1049, in _get_tick_bboxes
    extent = tick.label1.get_window_extent(renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/text.py", line 741, in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/text.py", line 311, in _get_layout
    ismath=False)
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_agg.py", line 223, in get_text_width_height_descent
    renderer=self)
  File "/usr/lib/python3/dist-packages/matplotlib/texmanager.py", line 670, in get_text_width_height_descent
    dvifile = self.make_dvi(tex, fontsize)
  File "/usr/lib/python3/dist-packages/matplotlib/texmanager.py", line 417, in make_dvi
    report))
RuntimeError: LaTeX was not able to process the following string:
b'lp'
Here is the full report generated by LaTeX: 

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
 restricted \write18 enabled.
entering extended mode
(./c5383a18897d5b8dd569836a32b6a2df.tex
LaTeX2e <2011/06/27>
Babel <3.9h> and hyphenation patterns for 7 languages loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))

! LaTeX Error: File `type1cm.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 

l.3 \renewcommand
                 {\rmdefault}{pnc}^^M
No pages of output.
Transcript written on c5383a18897d5b8dd569836a32b6a2df.log.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0