[Matplotlib-users] Alloc error

2006-12-01 Thread Tommy Grav

I recently upgraded to the latest version of matplotlib using the
ScipySuperpack. However it seems that pylab is not playing nice
with Tcl/Tkinter, creating an alloc problem. I am using ActiveTcl
8.5.00 and TclTkAquaBI-8.4.9.1.

The error is shown below:

[EMAIL PROTECTED] Phoebe1/Red -> python
ActivePython 2.4.3 Build 11 (ActiveState Software Inc.) based on
Python 2.4.3 (#1, Apr  3 2006, 18:07:18)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.__version__
'1.0.1.dev3436'
>>> import matplotlib
>>> import pylab
>>> matplotlib.__version__
'0.87.7'
>>> x = [0,0]
>>> y = [1,1]
>>> pylab.plot(x,y)
[]
>>> pylab.show()
alloc: invalid block: 0xa08aca0: a 9c 0

Abort
[EMAIL PROTECTED] Phoebe1/Red ->

A google search came up empty, except that this might be a Tcl
problem because threading was not enabled, but the ActiveTcl
should have that enabled. The problem showed up when I
upgraded to the new version of matplotlib, so I am wondering
if it is the culprit of the error. Any help is appreciated.

Cheers
   Tommy

[EMAIL PROTECTED]
http://homepage.mac.com/tgrav/
 
-
"Any intelligent fool can make things bigger, more complex, and more  
violent. It takes a touch of genius -- and a lot of courage -- to  
move in

the opposite direction" -- Albert Einstein




-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Legend colors

2006-12-01 Thread John Hunter
> "Friedrich," == Friedrich, Robin K <[EMAIL PROTECTED]> writes:

Friedrich,> I seem to experiencing a bug when doing bar charts and
Friedrich,> display a legend.  I'm calling the figlegend properly
Friedrich,> I think with a reference to the objects returned from
Friedrich,> the bar() calls. The problem is both color patches in
Friedrich,> the legend appear orange.  Any ideas?  I'm using
Friedrich,> matplotlib0.87.7, Python2.5, and Numpy 1.0.

bar_wait and bar_cpu are both lists of Rectangles, so the legend is
consuming bar_wait before it gets to bar_cpu.  Try passing the first
element of both:

figlegend( (bar_wait[0], bar_cpu[0]), ("Wait", "CPU"), "upper right", 
shadow=True)

JDH

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Legend colors

2006-12-01 Thread Friedrich, Robin K
I seem to experiencing a bug when doing bar charts and display a legend. 
I'm calling the figlegend properly I think with a reference to the objects
returned from the bar() calls. The problem is both color patches in the
legend appear orange.  Any ideas?
I'm using matplotlib0.87.7, Python2.5, and Numpy 1.0.

-Robin Friedrich

=
#!/usr/bin/env python2.5
from pylab import *
from matplotlib.ticker import MultipleLocator

def plot9(nodes, X, Y1, Y2):
i = 0
for node in nodes:
a = subplot(len(nodes), 1, i+1)
a.xaxis.set_major_locator(MultipleLocator(3))
a.xaxis.set_minor_locator(MultipleLocator(1))
a.yaxis.set_major_locator(MultipleLocator(50))
a.yaxis.set_minor_locator(MultipleLocator(10))
axis([0,24,0,100])
bar_cpu  = bar(X, Y1, width=0.75, color="blue")
bar_wait = bar(X, Y2, width=0.75, color="orange", bottom=Y1)
i += 1

xlabel("Hour of Day")
figtext(0.5, 0.96, "Compute Server Loading", horizontalalignment='center')
figlegend( (bar_wait, bar_cpu), ("Wait", "CPU"), "upper right", shadow=True)
savefig('fdxcn_plot', dpi=100)

nodes = "fdxcn01 fdxcn02".split()
cpu = [0,0,0,0,0,3,12,14,18,29,38,49,61,32,19,16,9,7,3,2,0,0,9,1]
t = []
wait = []
for i in range(len(cpu)):
t.append(i + 0.25)
wait.append(cpu[i]/3.0)
plot9(nodes, t, cpu, wait)

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plot problem

2006-12-01 Thread Gary
John Hunter wrote:
>> "Axel" == Axel Brink <[EMAIL PROTECTED]> writes:
>> 
> Axel> John, thanks for your suggestion. I would never have thought
> Axel> of looking for the cause of the problem in that
> Axel> direction. However, it isn't solved yet. The verbose mode
> Axel> yielded the line "numerix Numeric 23.7", which is apparently
> Axel> wrong. Actually I am trying to use SciPy, which I've heard
> Axel> is based on NumPy, so I believe this numerix thing should be
> Axel> connected with NumPy. I copied the file
> Axel> http://matplotlib.sf.net/matplotlibrc to
> Axel> ~/.matplotlib/matplotlibrc (such a file didn't exist) and
> Axel> now I get a new kind of error (see below). Do you (or
> Axel> anyone) have an idea what this is about? Thanks in advance!
>
> I'm sorry this is so frustrating -- it is certainly frustrating for
> me.  The problem is that matplotlib is trying to support three array
> packages (Numeric, numarray and numpy) and numpy itself is a fast
> moving target so if you don't have exactly the right numpy with
> exactly the right scipy with exactly the right matplotlib it is
> unlikely to work.
>
> I suggest either the latest release of all three, or the latest svn of
> all three.  I notice from your output that you have 0.87.3 which is
> several releases behind.  Try getting numpy 1.0 and matplotlib 0.87.7.
Windows users have to watch out: the current Scipy binary installer is 
out of sync with the current Numpy installer.
(I think the Scipy people are going to fix that soon.  In the meantime, 
I have a matched set of Numpy and Scipy installers for Windows and 
Python 2.4.3 that works with the latest mpl binary installer.  I'm happy 
to provide my installers if anyone wants them.  Contact me directly.)

-gary


> Good luck!
> JDH
>
> -
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>   


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plot problem

2006-12-01 Thread John Hunter
> "Axel" == Axel Brink <[EMAIL PROTECTED]> writes:
Axel> John, thanks for your suggestion. I would never have thought
Axel> of looking for the cause of the problem in that
Axel> direction. However, it isn't solved yet. The verbose mode
Axel> yielded the line "numerix Numeric 23.7", which is apparently
Axel> wrong. Actually I am trying to use SciPy, which I've heard
Axel> is based on NumPy, so I believe this numerix thing should be
Axel> connected with NumPy. I copied the file
Axel> http://matplotlib.sf.net/matplotlibrc to
Axel> ~/.matplotlib/matplotlibrc (such a file didn't exist) and
Axel> now I get a new kind of error (see below). Do you (or
Axel> anyone) have an idea what this is about? Thanks in advance!

I'm sorry this is so frustrating -- it is certainly frustrating for
me.  The problem is that matplotlib is trying to support three array
packages (Numeric, numarray and numpy) and numpy itself is a fast
moving target so if you don't have exactly the right numpy with
exactly the right scipy with exactly the right matplotlib it is
unlikely to work.

I suggest either the latest release of all three, or the latest svn of
all three.  I notice from your output that you have 0.87.3 which is
several releases behind.  Try getting numpy 1.0 and matplotlib 0.87.7.

Good luck!
JDH

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plot problem

2006-12-01 Thread Axel Brink

> Axel> Hello there, I have a strange plotting problem. In the
> Axel> example below I expect three equal plots of f, g and h: a
> Axel> simple inclined line, but g and h produce a sawtooth
> Axel> plot. What do I do wrong? Any help would be greatly
> Axel> appreceated.
>
> Not sure what your problem is -- I can run your script and get three
> identical lines as expected.
>
> My guess if you are mixing numpy with an incorrect matplotlib numerix
> setting.  If you are creating your arrays with numpy, you need to set
> "numerix :numpy" in your matplotlibrc file
>
>   http://matplotlib.sf.net/matplotlibrc
>
>
> You can find your numerix setting by running your script with 
>
>   > python myscript.py --verbose-helpful
>
> JDH
>   
John, thanks for your suggestion. I would never have thought of looking 
for the cause of the problem in that direction. However, it isn't solved 
yet. The verbose mode yielded the line "numerix Numeric 23.7", which is 
apparently wrong. Actually I am trying to use SciPy, which I've heard is 
based on NumPy, so I believe this numerix thing should be connected with 
NumPy. I copied the file http://matplotlib.sf.net/matplotlibrc to 
~/.matplotlib/matplotlibrc (such a file didn't exist) and now I get a 
new kind of error (see below). Do you (or anyone) have an idea what this 
is about? Thanks in advance!

Axel.

 > python datasetPrepare.py --verbose-helpful
matplotlib data path /usr/lib/python2.4/site-packages/matplotlib/mpl-data
$HOME=/staf/axel
CONFIGDIR=/staf/axel/.matplotlib
loaded rc file /staf/axel/.matplotlib/matplotlibrc
matplotlib version 0.87.3
verbose.level helpful
interactive is False
platform is linux2
Traceback (most recent call last):
  File "datasetPrepare.py", line 1, in ?
import glob, os, Image, pylab, scipy, scipy.signal, copy
  File "/usr/lib/python2.4/site-packages/pylab.py", line 1, in ?
from matplotlib.pylab import *
  File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line 196, 
in ?
import cm
  File "/usr/lib/python2.4/site-packages/matplotlib/cm.py", line 5, in ?
import colors
  File "/usr/lib/python2.4/site-packages/matplotlib/colors.py", line 33, 
in ?
from numerix import array, arange, take, put, Float, Int, where, \
  File 
"/usr/lib/python2.4/site-packages/matplotlib/numerix/__init__.py", line 
68, in ?
from _sp_imports import nx, infinity
  File 
"/usr/lib/python2.4/site-packages/matplotlib/numerix/_sp_imports.py", 
line 1, in ?
from numpy import Int8, UInt8, \
ImportError: cannot import name Int8


-- 
Axel Brink
Ph.D student
Artificial Intelligence
University of Groningen
www.ai.rug.nl/~axel
Tel.: +31 (0)50 363 7410
Postal addr.: Grote Kruisstraat 2/1, 9712 TS, Groningen, The Netherlands
Visiting addr.: Zernikepark 10, Groningen, The Netherlands


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plot problem

2006-12-01 Thread John Hunter
> "Axel" == Axel Brink <[EMAIL PROTECTED]> writes:

Axel> Hello there, I have a strange plotting problem. In the
Axel> example below I expect three equal plots of f, g and h: a
Axel> simple inclined line, but g and h produce a sawtooth
Axel> plot. What do I do wrong? Any help would be greatly
Axel> appreceated.

Not sure what your problem is -- I can run your script and get three
identical lines as expected.

My guess if you are mixing numpy with an incorrect matplotlib numerix
setting.  If you are creating your arrays with numpy, you need to set
"numerix :numpy" in your matplotlibrc file

  http://matplotlib.sf.net/matplotlibrc


You can find your numerix setting by running your script with 

  > python myscript.py --verbose-helpful

JDH

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Plot problem

2006-12-01 Thread Axel Brink
Hello there,

I have a strange plotting problem. In the example below I expect three 
equal plots of f, g and h: a simple inclined line, but g and h produce a 
sawtooth plot. What do I do wrong? Any help would be greatly appreceated.

Sincerely,
Axel Brink.

import numpy, pylab

f = range(500)
g = numpy.array(range(500))
h = list(numpy.array(range(500)))

pylab.plot(f)

pylab.figure()
pylab.plot(g)

pylab.figure()
pylab.plot(h)

pylab.show()

-- 
Axel Brink
Ph.D student
Artificial Intelligence
University of Groningen
www.ai.rug.nl/~axel
Tel.: +31 (0)50 363 7410
Postal addr.: Grote Kruisstraat 2/1, 9712 TS, Groningen, The Netherlands
Visiting addr.: Zernikepark 10, Groningen, The Netherlands


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] unable to use matplotlib from inside emacs on windows

2006-12-01 Thread Emin.shopper Martinian.shopper

Dear Nicolas,

Thank you very much for your suggestion. I can now use matplotlib and pylab
in non-interactive mode in emacs, which makes me very happy.

The only thing that would make me even happier is if I could use
matplotlib/pylab in interative mode through emacs :). That's probably a
longer term issue, though.

Thanks again,
-Emin

On 11/27/06, Nicolas Grilly <[EMAIL PROTECTED]> wrote:


I'm not sure, but I guess you should make
matplotlib.interactive(False) and matplotlib.use('PS') BEFORE
importing pylab.

Nicolas Grilly

On 11/16/06, Emin.shopper Martinian.shopper <[EMAIL PROTECTED]>
wrote:
> Whenever I try to use matplotlib from a python session inside emacs,
python
> freezes. What I do is start GNU Emacs version 21.1.3 for Windows, do
ESC-x
> shell and enter the commands shown below. Note that I set the backend to
PS
> and interactive to false, but my python interpreter still freezes. I
suspect
> that this is because matplotlib is generating some GUI events which
upset
> emacs. The example works fine if I run python through the shell without
> emacs, but I would very much like to run python through an emacs
session.
> Similar problems happen with other backends. Any suggestions on how to
solve
> this problem would be much appreciated.

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] ScipySuperpack

2006-12-01 Thread Tommy Grav
I installed the Mac ScipySuperpack (from http://www.scipy.org/Download).
However it seems that the version of matplotlib in there is not  
compatible with
their version of numpy

[EMAIL PROTECTED] ch2/pbcd -> python
ActivePython 2.4.3 Build 11 (ActiveState Software Inc.) based on
Python 2.4.3 (#1, Apr  3 2006, 18:07:18)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> import numpy
 >>> import pylab
 >>> x = range(1,10)
 >>> y = range(1,10)
 >>> pylab.plot(x,y)
[]
 >>> pylab.show()
alloc: invalid block: 0xa08bcd8: a 68 0

Abort
[EMAIL PROTECTED] ch2/pbcd ->

Anyone know how to fix this?

Cheers
   Tommy

-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users