Related
Using LaTeX with matplotlib I'm able to reproduce several commands. For example:
import numpy as np
import matplotlib.pyplot as plt
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
fig = plt.figure()
ax = fig.add_subplot()
foo = np.arange(8)
ax.plot(foo, foo, label=r"$\omega$")
ax.legend()
correctly gives the desired output.
However, I can't understand why I am unable to use the command \lVert. Changing in the previous code:
ax.plot(foo, foo, label=r"$\omega$")
to:
ax.plot(foo, foo, label=r"$\lVert \omega \lVert$"),
gives the following error:
Traceback (most recent call last):
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\texmanager.py", line 275, in _run_checked_subprocess
report = subprocess.check_output(command,
File "C:\Users\admin\anaconda3\lib\subprocess.py", line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Users\admin\anaconda3\lib\subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['latex', '-interaction=nonstopmode', '--halt-on-error', 'C:\\Users\\admin\\.matplotlib\\tex.cache\\2937b4303e7d9aeb9070eea14ecf2572.tex']' returned non-zero exit status 1.
Following the docs and some answers, I deleted my .matplotlib/tex.cache but it didn't work out. I also checked Miktex (my LaTeX distribution) is in my Windows PATH.
The whole error message is the following:
Traceback (most recent call last):
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\texmanager.py", line 275, in _run_checked_subprocess
report = subprocess.check_output(command,
File "C:\Users\admin\anaconda3\lib\subprocess.py", line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Users\admin\anaconda3\lib\subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['latex', '-interaction=nonstopmode', '--halt-on-error', 'C:\\Users\\admin\\.matplotlib\\tex.cache\\01217377e7c38555f6bd8b50bf425d29.tex']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\backends\backend_qt5.py", line 480, in _draw_idle
self.draw()
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 407, in draw
self.figure.draw(self.renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\artist.py", line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\figure.py", line 1863, in draw
mimage._draw_list_compositing_images(
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\image.py", line 131, in _draw_list_compositing_images
a.draw(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\artist.py", line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\cbook\deprecation.py", line 411, in wrapper
return func(*inner_args, **inner_kwargs)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\axes\_base.py", line 2747, in draw
mimage._draw_list_compositing_images(renderer, self, artists)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\image.py", line 131, in _draw_list_compositing_images
a.draw(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\artist.py", line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\legend.py", line 606, in draw
bbox = self._legend_box.get_window_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 346, in get_window_extent
w, h, xd, yd, offsets = self.get_extent_offsets(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 471, in get_extent_offsets
whd_list = [c.get_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 471, in <listcomp>
whd_list = [c.get_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 341, in get_extent
w, h, xd, yd, offsets = self.get_extent_offsets(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 544, in get_extent_offsets
whd_list = [c.get_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 544, in <listcomp>
whd_list = [c.get_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 341, in get_extent
w, h, xd, yd, offsets = self.get_extent_offsets(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 471, in get_extent_offsets
whd_list = [c.get_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 471, in <listcomp>
whd_list = [c.get_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 341, in get_extent
w, h, xd, yd, offsets = self.get_extent_offsets(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 544, in get_extent_offsets
whd_list = [c.get_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 544, in <listcomp>
whd_list = [c.get_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 886, in get_extent
bbox, info, d = self._text._get_layout(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\text.py", line 295, in _get_layout
w, h, d = renderer.get_text_width_height_descent(
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 227, in get_text_width_height_descent
w, h, d = texmanager.get_text_width_height_descent(
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\texmanager.py", line 423, in get_text_width_height_descent
dvifile = self.make_dvi(tex, fontsize)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\texmanager.py", line 309, in make_dvi
self._run_checked_subprocess(
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\texmanager.py", line 283, in _run_checked_subprocess
raise RuntimeError(
RuntimeError: latex was not able to process the following string:
b'$\\\\lVert \\\\omega \\\\lVert$'
Here is the full report generated by latex:
latex: security risk: running with elevated privileges
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 21.12.10) (preloaded format=latex.fmt)
restricted \write18 enabled.
entering extended mode
(C:/Users/admin/.matplotlib/tex.cache/01217377e7c38555f6bd8b50bf425d29.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2021-11-22>
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/base\article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/base\size10.clo))
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/type1cm\type1cm.sty)
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/cm-super\type1ec.sty
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/base\t1cmr.fd))
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/base\inputenc.sty)
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/geometry\geometry.sty
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/graphics\keyval.sty)
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/generic/iftex\ifvtex.sty
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/generic/iftex\iftex.sty))
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/geometry\geometry.cfg)
Package geometry Warning: Over-specification in `h'-direction.
`width' (5058.9pt) is ignored.
Package geometry Warning: Over-specification in `v'-direction.
`height' (5058.9pt) is ignored.
) (C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/base\textcomp.sty)
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/l3backend\l3backend-dvi
ps.def) (01217377e7c38555f6bd8b50bf425d29.aux)
*geometry* driver: auto-detecting
*geometry* detected driver: dvips
! Undefined control sequence.
<recently read> \lVert
l.19 {\rmfamily $\lVert
\omega \lVert$}
No pages of output.
Transcript written on 01217377e7c38555f6bd8b50bf425d29.log.
Traceback (most recent call last):
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\texmanager.py", line 275, in _run_checked_subprocess
report = subprocess.check_output(command,
File "C:\Users\admin\anaconda3\lib\subprocess.py", line 415, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Users\admin\anaconda3\lib\subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['latex', '-interaction=nonstopmode', '--halt-on-error', 'C:\\Users\\admin\\.matplotlib\\tex.cache\\01217377e7c38555f6bd8b50bf425d29.tex']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\backends\backend_qt5.py", line 480, in _draw_idle
self.draw()
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 407, in draw
self.figure.draw(self.renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\artist.py", line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\figure.py", line 1863, in draw
mimage._draw_list_compositing_images(
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\image.py", line 131, in _draw_list_compositing_images
a.draw(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\artist.py", line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\cbook\deprecation.py", line 411, in wrapper
return func(*inner_args, **inner_kwargs)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\axes\_base.py", line 2747, in draw
mimage._draw_list_compositing_images(renderer, self, artists)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\image.py", line 131, in _draw_list_compositing_images
a.draw(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\artist.py", line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\legend.py", line 606, in draw
bbox = self._legend_box.get_window_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 346, in get_window_extent
w, h, xd, yd, offsets = self.get_extent_offsets(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 471, in get_extent_offsets
whd_list = [c.get_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 471, in <listcomp>
whd_list = [c.get_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 341, in get_extent
w, h, xd, yd, offsets = self.get_extent_offsets(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 544, in get_extent_offsets
whd_list = [c.get_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 544, in <listcomp>
whd_list = [c.get_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 341, in get_extent
w, h, xd, yd, offsets = self.get_extent_offsets(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 471, in get_extent_offsets
whd_list = [c.get_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 471, in <listcomp>
whd_list = [c.get_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 341, in get_extent
w, h, xd, yd, offsets = self.get_extent_offsets(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 544, in get_extent_offsets
whd_list = [c.get_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 544, in <listcomp>
whd_list = [c.get_extent(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\offsetbox.py", line 886, in get_extent
bbox, info, d = self._text._get_layout(renderer)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\text.py", line 295, in _get_layout
w, h, d = renderer.get_text_width_height_descent(
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 227, in get_text_width_height_descent
w, h, d = texmanager.get_text_width_height_descent(
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\texmanager.py", line 423, in get_text_width_height_descent
dvifile = self.make_dvi(tex, fontsize)
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\texmanager.py", line 309, in make_dvi
self._run_checked_subprocess(
File "C:\Users\admin\anaconda3\lib\site-packages\matplotlib\texmanager.py", line 283, in _run_checked_subprocess
raise RuntimeError(
RuntimeError: latex was not able to process the following string:
b'$\\\\lVert \\\\omega \\\\lVert$'
Here is the full report generated by latex:
latex: security risk: running with elevated privileges
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 21.12.10) (preloaded format=latex.fmt)
restricted \write18 enabled.
entering extended mode
(C:/Users/admin/.matplotlib/tex.cache/01217377e7c38555f6bd8b50bf425d29.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2021-11-22>
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/base\article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/base\size10.clo))
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/type1cm\type1cm.sty)
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/cm-super\type1ec.sty
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/base\t1cmr.fd))
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/base\inputenc.sty)
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/geometry\geometry.sty
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/graphics\keyval.sty)
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/generic/iftex\ifvtex.sty
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/generic/iftex\iftex.sty))
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/geometry\geometry.cfg)
Package geometry Warning: Over-specification in `h'-direction.
`width' (5058.9pt) is ignored.
Package geometry Warning: Over-specification in `v'-direction.
`height' (5058.9pt) is ignored.
) (C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/base\textcomp.sty)
(C:\Users\admin\AppData\Local\Programs\MiKTeX\tex/latex/l3backend\l3backend-dvi
ps.def) (01217377e7c38555f6bd8b50bf425d29.aux)
*geometry* driver: auto-detecting
*geometry* detected driver: dvips
! Undefined control sequence.
<recently read> \lVert
l.19 {\rmfamily $\lVert
\omega \lVert$}
No pages of output.
Transcript written on 01217377e7c38555f6bd8b50bf425d29.log.
I have created a python program that uses matplotlib to plot data and it had been working fine until today, an error occured. The program uses AutoDateLocator and ConciseDateFormatter. As you can see in the last line of the error log below, the received error is:
> IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed
Since it would be really difficult to post more details about my program functionality as well as the data used, I was wondering if there is an obvious solution to the above-mentioned problem, or if you could guide me to where I should look for the problem.
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\tkinter_init_.py", line 1883,
in call
return self.func(*args)
File "C:\Users\Nick\Desktop\Uni\TUC
studies\thesis\Code\python\test\myGUI_V3.py", line 841, in plotMeas
fig.tight_layout()
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\cbook\deprecation.py",
line 411, in
wrapper
return func(*inner_args, **inner_kwargs)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\figure.py",
line 2613, in tight_layout
kwargs = get_tight_layout_figure(
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\tight_layout.py",
line 303, in get_tight_layout_figure
kwargs = auto_adjust_subplotpars(fig, renderer,
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\tight_layout.py",
line 84, in
auto_adjust_subplotpars
bb += [ax.get_tightbbox(renderer, for_layout_only=True)]
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axes_base.py",
line 4155, in
get_tightbbox
bb_xaxis = self.xaxis.get_tightbbox(
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axis.py", line
1109, in get_tightbbox
ticks_to_draw = self._update_ticks()
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axis.py", line
1030, in _update_ticks
minor_labels = self.minor.formatter.format_ticks(minor_locs)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\dates.py", line
797, in format_ticks
if len(np.unique(tickdate[:, level])) > 1:
IndexError: too many indices for array: array is 1-dimensional, but 2
were indexed
Traceback (most recent call last):
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\backends\backend_qt5.py",
line 480, in
_draw_idle
self.draw()
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py",
line 407, in draw
self.figure.draw(self.renderer)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\artist.py",
line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\figure.py",
line 1863, in draw
mimage._draw_list_compositing_images(
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\image.py", line
131, in
_draw_list_compositing_images
a.draw(renderer)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\artist.py",
line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\cbook\deprecation.py",
line 411, in wrapper
return func(*inner_args, **inner_kwargs)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axes_base.py",
line 2747, in draw
mimage._draw_list_compositing_images(renderer, self, artists)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\image.py", line
131, in
_draw_list_compositing_images
a.draw(renderer)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\artist.py",
line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axis.py", line
1164, in draw
ticks_to_draw = self._update_ticks()
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axis.py", line
1030, in _update_ticks
minor_labels = self.minor.formatter.format_ticks(minor_locs)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\dates.py", line
797, in format_ticks
if len(np.unique(tickdate[:, level])) > 1:
IndexError: too many indices for array: array is 1-dimensional, but 2
were indexed
Traceback (most recent call last):
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\backends\backend_qt5.py",
line 480, in
_draw_idle
self.draw()
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py",
line 407, in draw
self.figure.draw(self.renderer)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\artist.py",
line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\figure.py",
line 1863, in draw
mimage._draw_list_compositing_images(
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\image.py", line
131, in
_draw_list_compositing_images
a.draw(renderer)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\artist.py",
line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\cbook\deprecation.py",
line 411, in wrapper
return func(*inner_args, **inner_kwargs)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axes_base.py",
line 2747, in draw
mimage._draw_list_compositing_images(renderer, self, artists)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\image.py", line
131, in
_draw_list_compositing_images
a.draw(renderer)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\artist.py",
line 41, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axis.py", line
1164, in draw
ticks_to_draw = self._update_ticks()
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axis.py", line
1030, in _update_ticks
minor_labels = self.minor.formatter.format_ticks(minor_locs)
File
"C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\dates.py", line
797, in format_ticks
if len(np.unique(tickdate[:, level])) > 1:
IndexError: too many indices for array: array is 1-dimensional, but 2
were indexed
As it turns out, it was a problem of the setup of the AutoDateLocator. Because of the specific dataset, the minor ticks could not be set correctly, based on the values I had selected for minticks, maxticks, and for the intervald tuples chosen. As a result, when the ConciseDateFormatter tried to use the locator for the minor ticks, the above-mentioned error occured.
When used a simple DateFormatter, there was no error, but neither the minor ticks, nor their labels appeared on the plot.
I am plotting a barplot using the seaborn.barplot method. The plotting is going through fine. When I am trying to add text on above the bars for better explanation using text method I am running into above mentioned issue.
Below is the code I have tried. With this code I am getting plot like this but i need plot like
this
where values displayed at top of bar are the raised_amount_in_millions value
Here is my code
groupedvalues=master_frame_backup1.groupby('funding_round_type')['raised_amount_in_millions'].mean().reset_index()
#groupedvalues
plt.figure(figsize=(30,8))
pal = sns.color_palette("Greens_d", len(groupedvalues))
rank = groupedvalues["raised_amount_in_millions"].argsort().argsort()
g=sns.barplot(x='funding_round_type',y='raised_amount_in_millions',data=groupedvalues, palette=np.array(pal[::-1])[rank])
for index, row in groupedvalues.iterrows():
g.text(row.funding_round_type, row.raised_amount_in_millions," "+str(row.raised_amount_in_millions), color='black', ha="center")
plt.show()
But I am running into above mentioned error. Any help?
Here is the error stack
Here is the error stack
Error in callback .post_execute at 0x00000211F5EB2378> (for post_execute):
Traceback (most recent call last):
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\pyplot.py", line 109, in post_execute
draw_all()
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib_pylab_helpers.py", line 132, in draw_all
f_mgr.canvas.draw_idle()
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\backend_bases.py", line 1899, in draw_idle
self.draw(*args, **kwargs)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 402, in draw
self.figure.draw(self.renderer)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\artist.py", line 50, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\figure.py", line 1649, in draw
renderer, self, artists, self.suppressComposite)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\image.py", line 138, in _draw_list_compositing_images
a.draw(renderer)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\artist.py", line 50, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\axes_base.py", line 2610, in draw
mimage._draw_list_compositing_images(renderer, self, artists)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\image.py", line 138, in _draw_list_compositing_images
a.draw(renderer)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\artist.py", line 50, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\text.py", line 709, in draw
bbox, info, descent = textobj._get_layout(renderer)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\text.py", line 286, in _get_layout
key = self.get_prop_tup(renderer=renderer)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\text.py", line 871, in get_prop_tup
x, y = self.get_unitless_position()
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\text.py", line 853, in get_unitless_position
x = float(self.convert_xunits(self._x))
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\artist.py", line 186, in convert_xunits
return ax.xaxis.convert_units(x)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\axis.py", line 1530, in convert_units
ret = self.converter.convert(x, self.units, self)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\category.py", line 53, in convert
unit.update(values)
AttributeError: 'NoneType' object has no attribute 'update'
Traceback (most recent call last):
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\IPython\core\formatters.py", line 341, in call
return printer(obj)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\IPython\core\pylabtools.py", line 244, in
png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs))
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\IPython\core\pylabtools.py", line 128, in print_figure
fig.canvas.print_figure(bytes_io, **kw)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\backend_bases.py", line 2049, in print_figure
**kwargs)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 510, in print_png
FigureCanvasAgg.draw(self)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\backends\backend_agg.py", line 402, in draw
self.figure.draw(self.renderer)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\artist.py", line 50, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\figure.py", line 1649, in draw
renderer, self, artists, self.suppressComposite)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\image.py", line 138, in _draw_list_compositing_images
a.draw(renderer)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\artist.py", line 50, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\axes_base.py", line 2610, in draw
mimage._draw_list_compositing_images(renderer, self, artists)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\image.py", line 138, in _draw_list_compositing_images
a.draw(renderer)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\artist.py", line 50, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\text.py", line 709, in draw
bbox, info, descent = textobj._get_layout(renderer)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\text.py", line 286, in _get_layout
key = self.get_prop_tup(renderer=renderer)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\text.py", line 871, in get_prop_tup
x, y = self.get_unitless_position()
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\text.py", line 853, in get_unitless_position
x = float(self.convert_xunits(self._x))
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\artist.py", line 186, in convert_xunits
return ax.xaxis.convert_units(x)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\axis.py", line 1530, in convert_units
ret = self.converter.convert(x, self.units, self)
File "C:\Users\mmajgaon.ORADEV\AppData\Local\Continuum\anaconda3\lib\site-packages\matplotlib\category.py", line 53, in convert
unit.update(values)
AttributeError: 'NoneType' object has no attribute 'update'
I try to run the following python code (Python 3.4.7 + scipy installed; MikTeX 2.9.4476 installed; Windows 7)
from matplotlib import pyplot as plt
from matplotlib.pyplot import rc
rc('text', usetex=True)
# plotting
data = range(100)
plt.plot(data, data, label='0.3 m')
plt.legend()
plt.savefig("test.png")
plt.savefig("test.svg")
# plt.show()
and get the following errors if I use plt.savefig("test.svg") or any other vector graphics format. Without this saving command everything works fine. Printed Errors:
Traceback (most recent call last):
File "U:\ICCAP\S_SVN\ETHAN\test.py", line 12, in <module>
plt.savefig("test.svg")
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\pyplot.py", line 688, in savefig
res = fig.savefig(*args, **kwargs)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\figure.py", line 1539, in savefig
self.canvas.print_figure(*args, **kwargs)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\backend_bases.py", line 2230, in print_figure
**kwargs)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\backends\backend_svg.py", line 1206, in print_svg
return self._print_svg(filename, svgwriter, fh_to_close, **kwargs)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\backends\backend_svg.py", line 1234, in _print_svg
self.figure.draw(renderer)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\artist.py", line 61, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\figure.py", line 1133, in draw
func(*args)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\artist.py", line 61, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\axes\_base.py", line 2304, in draw
a.draw(renderer)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\artist.py", line 61, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\legend.py", line 482, in draw
self._legend_box.draw(renderer)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\offsetbox.py", line 286, in draw
c.draw(renderer)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\offsetbox.py", line 286, in draw
c.draw(renderer)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\offsetbox.py", line 286, in draw
c.draw(renderer)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\offsetbox.py", line 286, in draw
c.draw(renderer)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\offsetbox.py", line 867, in draw
self._text.draw(renderer)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\artist.py", line 61, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\text.py", line 792, in draw
mtext=mtext)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\backends\backend_svg.py", line 1152, in draw_tex
self._draw_text_as_path(gc, x, y, s, prop, angle, ismath="TeX")
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\backends\backend_svg.py", line 957, in _draw_text_as_path
return_new_glyphs_only=True)
File "C:\WinPython-32bit-3.4.3.7Qt5\python-3.4.3\lib\site-packages\matplotlib\textpath.py", line 346, in get_glyphs_tex
font.select_charmap(charmap_code)
RuntimeError: In select_charmap: Could not set the charmap
any ideas what's going wrong/ could be improved?
I also had the same issue, and I fixed it by upgrading matplotlib to 1.5.1. It seems to be related with Matplotlib trying to render some fonts and not catching an exception that should've been caught.
Related: https://github.com/matplotlib/matplotlib/pull/5770#issuecomment-168212746
I am currently dealing with an inexplicable bug in python+matplotlib+numpy. I'm under Ubuntu 13.04 x64 in a VirtualBox hosted by Windows 7 pro x64 and I use python 2.7 (installed from the Ubuntu repositories).
Consider the following script that plots y as a function of x from a two column file named data.txt :
#!/usr/bin/env python
import numpy as np
import matplotlib as mpl
mpl.rcParams['text.usetex']=True
import matplotlib.pyplot as plt
x, y = np.loadtxt("data.txt", unpack=True)
plt.plot(x, y)
plt.show()
And consider the following data.txt :
-49.5938 2.0
-40.6585 0.156267
-39.7351 0.0616373
-39.1767 0.00565121
-38.7736 -0.0346863
-38.4573 -0.0664897
-38.1965 -0.0929013
-37.9744 -0.115588
-37.7809 -0.135542
-37.6093 -0.153403
-37.4551 -0.169605
-37.3151 -0.18446
-37.1868 -0.198198
-37.0684 -0.210994
-36.9584 -0.222983
-36.8722 -0.232458
-36.8228 -0.237918
-36.7749 -0.243232
-36.7284 -0.248409
-36.6833 -0.253457
-36.6395 -0.258382
-36.5968 -0.263192
-36.5553 -0.267892
-36.5149 -0.272489
-36.4754 -0.276987
-36.437 -0.281392
-36.3994 -0.285707
-36.3628 -0.289937
-36.3269 -0.294086
-36.2919 -0.298157
-36.2577 -0.302154
-36.2241 -0.30608
-36.1913 -0.309937
-36.1591 -0.313729
-36.1276 -0.317458
-36.0966 -0.321126
-36.0663 -0.324736
-36.0366 -0.32829
-36.0074 -0.33179
-35.9787 -0.335238
-35.9505 -0.338635
-35.9228 -0.341984
-35.8956 -0.345286
-35.8688 -0.348542
-35.8425 -0.351755
-35.8166 -0.354925
-35.7912 -0.358053
-35.7661 -0.361142
-35.7414 -0.364192
-35.7171 -0.367205
-35.6931 -0.37018
-35.6695 -0.373121
-35.6463 -0.376027
-35.6234 -0.378899
-35.6008 -0.381739
-35.5785 -0.384547
-35.5565 -0.387324
-35.5348 -0.390071
-35.5134 -0.392789
-35.4923 -0.395479
-35.4714 -0.39814
-35.4508 -0.400775
-35.4305 -0.403383
-35.4104 -0.405965
-35.3906 -0.408522
-35.371 -0.411054
-35.3517 -0.413563
-35.3326 -0.416047
-35.3137 -0.418509
-35.295 -0.420948
-35.2765 -0.423366
-35.2582 -0.425762
-35.2402 -0.428137
-35.2223 -0.430491
-35.2047 -0.432825
-35.1872 -0.43514
-35.1699 -0.437435
-35.1528 -0.439711
-35.1358 -0.44197
-35.119 -0.444212
-35.1024 -0.44644
-35.0859 -0.448658
-35.0694 -0.450878
-35.0529 -0.453105
-35.0363 -0.455341
-35.0195 -0.457613
-35.0024 -0.459933
-34.9849 -0.462312
-34.9669 -0.464766
-34.9483 -0.467309
-34.9292 -0.469936
-34.9092 -0.472681
-34.8886 -0.475519
-34.8672 -0.47848
-34.8449 -0.481569
-34.8219 -0.484767
-34.7982 -0.48807
-34.7739 -0.491477
-34.7491 -0.494958
-34.7241 -0.49848
-34.6992 -0.502011
-34.6742 -0.505551
-34.6495 -0.509079
-34.625 -0.512581
-34.6007 -0.516063
-34.5767 -0.519519
-34.553 -0.522941
-34.5296 -0.526332
-34.5065 -0.529692
-34.4837 -0.533017
-34.4612 -0.536311
-34.439 -0.539573
-34.4171 -0.542805
-34.3954 -0.546006
-34.374 -0.549176
-34.3529 -0.552316
-34.3321 -0.555427
-34.3115 -0.55851
-34.2912 -0.561564
-34.2711 -0.564591
-34.2512 -0.567592
-34.2316 -0.570566
-34.2121 -0.573515
-34.193 -0.576439
-34.174 -0.579339
-34.1552 -0.582214
-34.1367 -0.585066
-34.1183 -0.587895
-34.1002 -0.590701
-34.0822 -0.593485
-34.0644 -0.596248
-34.0468 -0.598989
-34.0294 -0.601709
-34.0122 -0.604409
-33.9951 -0.607089
-33.9783 -0.609748
-33.9615 -0.612389
-33.945 -0.615011
-33.9286 -0.617614
-33.9123 -0.620199
-33.8962 -0.622766
-33.8803 -0.625315
-33.8645 -0.627847
-33.8489 -0.630361
-33.8334 -0.632859
-33.818 -0.635341
-33.8028 -0.637806
-33.7877 -0.640256
-33.7727 -0.64269
-33.7579 -0.645108
-33.7432 -0.647511
-33.7286 -0.6499
-33.7141 -0.652274
-33.6998 -0.654634
-33.6856 -0.65698
-33.6714 -0.659315
-33.6574 -0.661635
-33.6435 -0.663947
-33.6297 -0.666249
-33.6159 -0.668547
-33.6022 -0.670835
-33.5885 -0.673127
-33.5749 -0.67542
-33.5612 -0.677726
-33.5475 -0.680025
-33.5338 -0.682341
-33.5201 -0.684666
-33.5062 -0.687017
-33.4923 -0.689387
-33.4782 -0.691796
-33.4639 -0.694247
-33.4494 -0.696723
-33.4347 -0.69924
-33.4199 -0.7018
-33.4047 -0.704414
-33.3893 -0.707087
-33.3737 -0.709791
-33.3578 -0.712549
-33.3418 -0.71534
-33.3255 -0.718181
-33.3091 -0.721056
-33.2924 -0.723999
-33.2755 -0.726975
-33.2585 -0.729988
-33.2412 -0.733045
-33.2237 -0.736152
-33.2061 -0.739295
-33.1884 -0.742461
-33.1706 -0.745656
-33.1525 -0.748904
-33.1344 -0.752172
-33.1162 -0.755459
-33.098 -0.758756
-33.0798 -0.762079
-33.0616 -0.765406
-33.0434 -0.768737
-33.0252 -0.772066
-33.0072 -0.775386
-32.9892 -0.778712
-32.9713 -0.78203
-32.9535 -0.785343
-32.9358 -0.788648
-32.9182 -0.791942
-32.9007 -0.795223
-32.8833 -0.798485
-32.8661 -0.801738
-32.8489 -0.804987
-32.8319 -0.808216
-32.8151 -0.811425
-32.7984 -0.814617
-32.7817 -0.817795
-32.7653 -0.82096
-32.7489 -0.824109
-32.7327 -0.82724
-32.7166 -0.830353
-32.7007 -0.833449
-32.6848 -0.83653
-32.6691 -0.839596
-32.6536 -0.842642
-32.6381 -0.845671
-32.6228 -0.848682
-32.6076 -0.85168
-32.5925 -0.854664
-32.5776 -0.857631
-32.5627 -0.860578
-32.548 -0.863512
-32.5334 -0.866433
-32.5189 -0.869332
-32.5046 -0.872219
-32.4903 -0.87509
-32.4761 -0.877949
-32.4621 -0.880793
-32.4481 -0.883619
-32.4343 -0.886435
-32.4205 -0.889237
-32.4069 -0.892021
-32.3934 -0.894796
-32.3799 -0.897551
-32.3666 -0.900292
-32.3534 -0.903023
-32.3402 -0.905737
-32.3272 -0.908445
-32.3142 -0.911134
-32.3013 -0.913813
-32.2885 -0.916482
-32.2759 -0.919132
-32.2633 -0.921769
-32.2507 -0.924401
-32.2383 -0.92702
-32.2259 -0.929628
-32.2136 -0.932223
-32.2015 -0.934805
-32.1893 -0.937376
-32.1773 -0.939932
-32.1654 -0.942481
-32.1535 -0.94502
-32.1417 -0.947543
-32.13 -0.950056
-32.1183 -0.95256
-32.1068 -0.955052
-32.0952 -0.957536
-32.0838 -0.960005
-32.0725 -0.962469
-32.0612 -0.964924
-32.0499 -0.967368
-32.0387 -0.969807
-32.0276 -0.972236
-32.0165 -0.974663
-32.0055 -0.977076
-31.9946 -0.979485
If I try to execute the script, I got the following error :
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1473, in __call__
return self.func(*args)
File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.py", line 276, in resize
self.show()
File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.py", line 348, in draw
FigureCanvasAgg.draw(self)
File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_agg.py", line 440, in draw
self.figure.draw(self.renderer)
File "/usr/lib/pymodules/python2.7/matplotlib/artist.py", line 54, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/figure.py", line 1006, in draw
func(*args)
File "/usr/lib/pymodules/python2.7/matplotlib/artist.py", line 54, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/axes.py", line 2086, in draw
a.draw(renderer)
File "/usr/lib/pymodules/python2.7/matplotlib/artist.py", line 54, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/axis.py", line 1052, in draw
renderer)
File "/usr/lib/pymodules/python2.7/matplotlib/axis.py", line 1001, in _get_tick_bboxes
extent = tick.label1.get_window_extent(renderer)
File "/usr/lib/pymodules/python2.7/matplotlib/text.py", line 752, in get_window_extent
bbox, info = self._get_layout(self._renderer)
File "/usr/lib/pymodules/python2.7/matplotlib/text.py", line 313, in _get_layout
ismath=ismath)
File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_agg.py", line 200, in get_text_width_height_descent
renderer=self)
File "/usr/lib/pymodules/python2.7/matplotlib/texmanager.py", line 606, in get_text_width_height_descent
page = next(iter(dvi))
File "/usr/lib/pymodules/python2.7/matplotlib/dviread.py", line 71, in __iter__
have_page = self._read()
File "/usr/lib/pymodules/python2.7/matplotlib/dviread.py", line 126, in _read
byte = ord(self.file.read(1)[0])
IndexError: string index out of range
The interesting thing, is that :
If I replace the two last values of the file by -32.0 -1.0 it works
If I remove mpl.rcParams['text.usetex']=True it also works
I would be very happy if one have any explanation about that very bizarre problem.