Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

matplotlib breaks str( ) in Python 2.7.3 on Windows

Here is an illustration of the problem in iPython. This is reproducible in every other Python shell I have tried.

In [1]: a = 1e-6

In [2]: str(a)
Out[2]: '1e-06'

In [3]: import matplotlib as mpl

In [4]: str(a)
Out[4]: '1e-06'

In [5]: import matplotlib.pyplot as plt

In [6]: str(a)
Out[6]: '1e-06'

In [7]: plt.plot(1.0)
Out[7]: [<matplotlib.lines.Line2D at 0x262a850>]

In [8]: str(a)
Out[8]: '1e-06'

In [9]: plt.show()

In [10]: str(a)
Out[10]: 'ERR'

And here are the relevant version numbers.

In [11]: mpl.__version__
Out[11]: '1.2.0'

In [12]: import numpy as np

In [13]: np.__version__
Out[13]: '1.6.2'

This is happening on my XP Professional lab computer running Python 2.7.3 and Microsoft Visual Express 2008 C++ and Basic. I have no idea how to begin tracking down the problem.

like image 650
Nik Hartman Avatar asked Mar 17 '26 04:03

Nik Hartman


1 Answers

Enthought answered this question by existing. It's not the most satisfying solution, but I couldn't justify spending days and days trying to track down the root of the problem described above.

like image 180
Nik Hartman Avatar answered Mar 19 '26 18:03

Nik Hartman