Installation/Compatibility problem with matplotlib

51 views
Skip to first unread message

mhecht

unread,
Mar 19, 2010, 4:09:20 AM3/19/10
to scitools
Hello,

I'm quite new to scitools, so sorry if the question/problem is
stupid.
I tried to execute the following (well known) script to check some
basic functionality:

from scitools.std import *

def f(t):
return t**2*exp(-t**2)

t = linspace(0, 3, 51) # 51 points between 0 and 3
y = zeros(len(t)) # allocate y with float elements
for i in xrange(len(t)):
y[i] = f(t[i])

plot(t, y)

From this I get the following error:

scitools.easyviz backend is matplotlib
Traceback (most recent call last):
File "plot.py", line 11, in <module>
plot(t, y)
File "F:\Python25\Lib\site-packages\scitools\easyviz\common.py",
line 3060, in plot
self._replot()
File "F:\Python25\Lib\site-packages\scitools\easyviz
\matplotlib_.py", line 906, in _replot
self._g.draw()
File "F:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 352,
in draw
get_current_fig_manager().canvas.draw()
File "F:\Python25\Lib\site-packages\matplotlib\backends
\backend_tkagg.py", line 215, in draw
FigureCanvasAgg.draw(self)
File "F:\Python25\Lib\site-packages\matplotlib\backends
\backend_agg.py", line 314, in draw
self.figure.draw(self.renderer)
File "F:\Python25\Lib\site-packages\matplotlib\artist.py", line 46,
in draw_wrapper
draw(artist, renderer, *kl)
File "F:\Python25\Lib\site-packages\matplotlib\figure.py", line 773,
in draw
for a in self.axes: a.draw(renderer)
File "F:\Python25\Lib\site-packages\matplotlib\artist.py", line 46,
in draw_wrapper
draw(artist, renderer, *kl)
File "F:\Python25\Lib\site-packages\matplotlib\axes.py", line 1735,
in draw
a.draw(renderer)
File "F:\Python25\Lib\site-packages\matplotlib\artist.py", line 46,
in draw_wrapper
draw(artist, renderer, *kl)
File "F:\Python25\Lib\site-packages\matplotlib\axis.py", line 742,
in draw
tick.draw(renderer)
File "F:\Python25\Lib\site-packages\matplotlib\artist.py", line 46,
in draw_wrapper
draw(artist, renderer, *kl)
File "F:\Python25\Lib\site-packages\matplotlib\axis.py", line 196,
in draw
self.label1.draw(renderer)
File "F:\Python25\Lib\site-packages\matplotlib\text.py", line 515,
in draw
bbox, info = self._get_layout(renderer)
File "F:\Python25\Lib\site-packages\matplotlib\text.py", line 279,
in _get_layout
clean_line, self._fontproperties, ismath=ismath)
File "F:\Python25\Lib\site-packages\matplotlib\backends
\backend_agg.py", line 148, in get_text_width_height_descent
texmanager = self.get_texmanager()
File "F:\Python25\Lib\site-packages\matplotlib\backend_bases.py",
line 374, in get_texmanager
from matplotlib.texmanager import TexManager
File "F:\Python25\Lib\site-packages\matplotlib\texmanager.py", line
72, in <module>
class TexManager:
File "F:\Python25\Lib\site-packages\matplotlib\texmanager.py", line
94, in TexManager
_dvipng_hack_alpha = dvipng_hack_alpha()
File "F:\Python25\Lib\site-packages\matplotlib\texmanager.py", line
68, in dvipng_hack_alpha
raise RuntimeError('Could not obtain dvipng version')
RuntimeError: Could not obtain dvipng version

The check of matplotlib works well as long as I don't import
scitools.std:
import matplotlib.pyplot as plt
import numpy
x = numpy.linspace(0, 2*numpy.pi, 101)
y = numpy.sin(x)
plt.plot(x, y)
plt.show()
raw_input('Press Enter: ')

I have the newest (today) versions of numpy, scypy, scitools,
matplotlib and work with Python 2.5 under windows.

Where is the problem?


Johannes Ring

unread,
Mar 19, 2010, 5:17:10 AM3/19/10
to scit...@googlegroups.com
Hi,

Try to turn off latex by running your script like this:

python your_script.py --SCITOOLS_matplotlib_text.usetex False

If this work you can change the text.usetex option permanently in the
matplotlib section in the SciTools configuration file (scitools.cfg).

In the subversion repository, we have changed the default behavior to
not use latex by default in the matplotlib backend.

Johannes

> --
> You received this message because you are subscribed to the Google Groups "scitools" group.
> To post to this group, send email to scit...@googlegroups.com.
> To unsubscribe from this group, send email to scitools+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/scitools?hl=en.
>
>

mhecht

unread,
Mar 19, 2010, 6:43:22 AM3/19/10
to scitools
Thank You for Your answer, the proposed solution works!

On 19 Mrz., 10:17, Johannes Ring <joha...@simula.no> wrote:
> Hi,
>
> Try to turn off latex by running your script like this:
>
>   python your_script.py --SCITOOLS_matplotlib_text.usetex False
>
> If this work you can change the text.usetex option permanently in the
> matplotlib section in the SciTools configuration file (scitools.cfg).
>
> In the subversion repository, we have changed the default behavior to
> not use latex by default in the matplotlib backend.
>
> Johannes
>

Reply all
Reply to author
Forward
0 new messages