J. Stark | 1 Dec 14:04
Picon

OSX Leopard Install TkAgg Problem and Solution

I don't know if this was peculiar to my set-up but others might find 
this useful.

I recently installed Matplotlib 0.90.1 from source on a G4 Powerbook 
and a dual G5 PowerMac, both running OSX 10.5.1. Installation 
proceeded smoothly and once the by now well documented  python path 
issue had been fixed, Matplotlib imported and ran fine with the Agg 
back-end.

However, attempting to use TkAgg led to allocation error somewhere 
deep in Tcl. I finally traced this to the fact that I had a legacy 
version of the Tcl and Tk frameworks in /Library/Frameworks. These 
were being used in preference to the Leopard installed frameworks in 
/System//Library/Frameworks. Removing the /Library/Frameworks solved 
these problems.

J.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
Yongtao Cui | 2 Dec 22:07
Picon

RuntimeError after clearing and plotting for many times

Hi,

I got the following error when clearing and plotting on the same
figure for many times. I found the following minimum code to reproduce
this error. I am using matplotlib-0.91.1 and wxpython2.8 on windows
xp. In the matplotlibrc file, I changed the backend to WXAgg and
interactive to True.

import pylab
def test(n):
    for i in range(n):
        f=pylab.figure(1)
        f.clf()
        a=f.add_axes([0.2, 0.2, 0.6, 0.6])
        a.plot([1,2,3,4,5], 'ro')

The error only happens for a large n. For example, test(10) works
fine, but test(50) will cause the error. Also runing test(10) for a
few times will also cause the error.

Could anyone give me some help?

Thanks.

The following is the error message:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "<input>", line 3, in test
  File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 191, in figure
(Continue reading)

Yongtao Cui | 2 Dec 22:15
Picon

Re: RuntimeError after clearing and plotting for many times

Below is the minimum code with the right indent

import pylab
def test(n):
     for i in range(n):
          f=pylab.figure(1)
          f.clf()
          a=f.add_axes([0.2, 0.2, 0.6, 0.6])
          a.plot([1,2,3,4,5], 'ro')

On Dec 2, 2007 4:07 PM, Yongtao Cui <cuiyongtao@...> wrote:
> Hi,
>
> I got the following error when clearing and plotting on the same
> figure for many times. I found the following minimum code to reproduce
> this error. I am using matplotlib-0.91.1 and wxpython2.8 on windows
> xp. In the matplotlibrc file, I changed the backend to WXAgg and
> interactive to True.
>
> import pylab
> def test(n):
>    for i in range(n):
>        f=pylab.figure(1)
>        f.clf()
>        a=f.add_axes([0.2, 0.2, 0.6, 0.6])
>        a.plot([1,2,3,4,5], 'ro')
>
>
> The error only happens for a large n. For example, test(10) works
> fine, but test(50) will cause the error. Also runing test(10) for a
(Continue reading)

Fernando Perez | 2 Dec 23:30
Picon
Gravatar

Re: RuntimeError after clearing and plotting for many times

On Dec 2, 2007 2:07 PM, Yongtao Cui <cuiyongtao@...> wrote:

> Could anyone give me some help?

No help here, just providing a data point for the devs.  Under linux, with

In [5]: wx.__version__
Out[5]: '2.8.4.0'

In [6]: matplotlib.__version__
Out[6]: '0.91.1'

I ran test(100) several times, no error.

Cheers,

f

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
ray sa | 2 Dec 23:50
Picon
Favicon

continuous plotting..

Hello

I am trying to use this application to plot a diagram from a log file that is always active and storing data. I have written the following and I have issues once I touch the figure window it freezes...

from pylab import *
import time
val = 1

while True:
    inData = load('c:\\data.txt')
    x = inData[:,0]
    y = inData[:,1]
    plot(x,y,'o')
    if val == 1:
        show()
    time.sleep(1)
    if val == 0:
        val = 0
    time.sleep(1)
    draw()

I am using the following program to create some dummy data:

import time
import math

def test():
    for i in range(900):
        for rad in sineVal:
            fileData = open('c:\\data.txt','a')
            time.sleep(1) 
            fileData.write('%d' % int(i))
            fileData.write('\t')
            fileData.write('%f' % math.sin(rad))
            fileData.write('\n')
            fileData.close()
            print('*'),

def makeArray():
    tempArray = []
    for i in range(0,360,180):
        tempArray.append(i)
    return tempArray

sineVal = makeArray()

test()

You help and suggestion in the above matter will be most welcomed.

BR /ray


Never miss a thing. Make Yahoo your homepage.
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Eric Firing | 3 Dec 00:30
Favicon
Gravatar

Re: continuous plotting..

Ray,

The first problem is that you are calling show() repeatedly, but show() 
should only be called once per script; it is used in non-interactive 
plotting.  Now I see that you are trying to prevent that, but the code 
as it came out in your email does not do so--val never gets set to zero.

Note that by default, repeated calls to plot overlay more and more plot 
elements; I don't think this is what you want.

To get ideas, you might look at anim.py and strip_chart_demo.py in the 
examples directory.

Eric

ray sa wrote:
> Hello
> 
> I am trying to use this application to plot a diagram from a log file 
> that is always active and storing data. I have written the following and 
> I have issues once I touch the figure window it freezes...
> 
> from pylab import *
> import time
> val = 1
> 
> while True:
>     inData = load('c:\\data.txt')
>     x = inData[:,0]
>     y = inData[:,1]
>     plot(x,y,'o')
>     if val == 1:
>         show()
>     time.sleep(1)
>     if val == 0:
>         val = 0
>     time.sleep(1)
>     draw()
> 
> I am using the following program to create some dummy data:
> 
> import time
> import math
> 
> def test():
>     for i in range(900):
>         for rad in sineVal:
>             fileData = open('c:\\data.txt','a')
>             time.sleep(1) 
>             fileData.write('%d' % int(i))
>             fileData.write('\t')
>             fileData.write('%f' % math.sin(rad))
>             fileData.write('\n')
>             fileData.close()
>             print('*'),
> 
> def makeArray():
>     tempArray = []
>     for i in range(0,360,180):
>         tempArray.append(i)
>     return tempArray
> 
> sineVal = makeArray()
> 
> test()
> 
> You help and suggestion in the above matter will be most welcomed.
> 

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
brett.mcsweeney | 3 Dec 00:34
Favicon

Re: continuous plotting..


Hello Ray,

There appears to be something wrong with the way "val" is used in the first code section (if val==0: val = 0 ?), unless it is modified externally somehow?

I would also suggest adding random values or some such to make the test data non-periodic, so that it doesn't always look the same.

Best regards,
Brett McSweeney



ray sa <bizag007-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>
Sent by: matplotlib-users-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org

03/12/2007 09:50 AM

To
matplotlib-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
cc
Subject
[Matplotlib-users] continuous plotting..





Hello

I am trying to use this application to plot a diagram from a log file that is always active and storing data. I have written the following and I have issues once I touch the figure window it freezes...

from pylab import *
import time
val = 1

while True:
   inData = load('c:\\data.txt')
   x = inData[:,0]
   y = inData[:,1]
   plot(x,y,'o')
   if val == 1:
       show()
   time.sleep(1)
   if val == 0:
       val = 0
   time.sleep(1)
   draw()

I am using the following program to create some dummy data:

import time
import math

def test():
   for i in range(900):
       for rad in sineVal:
           fileData = open('c:\\data.txt','a')
           time.sleep(1)  
           fileData.write('%d' % int(i))
           fileData.write('\t')
           fileData.write('%f' % math.sin(rad))
           fileData.write('\n')
           fileData.close()
           print('*'),

def makeArray():
   tempArray = []
   for i in range(0,360,180):
       tempArray.append(i)
   return tempArray

sineVal = makeArray()

test()

You help and suggestion in the above matter will be most welcomed.

BR /ray

 

Never miss a thing. Make Yahoo your homepage.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4_______________________________________________
Matplotlib-users mailing list
Matplotlib-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


UNITED GROUP
This email message is the property of United Group. The information in this email is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, you may not disclose, copy or distribute this email, nor take or omit to take any action in reliance on it. United Group accepts no liability for any damage caused by this email or any attachments due to viruses, interference, interception, corruption or unauthorised access.
If you have received this email in error, please notify United Group immediately by email to the sender's email address and delete this document.

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Chris Fonnesbeck | 3 Dec 04:23
Picon

hist() hangs on OSX 10.5

Running a recent build from svn on OSX 10.5, the TkAgg interface
becomes unresponsive after plotting a histogram and calling show().
Here is a sample from the process, in case it is useful:

Sampling process 5635 for 3 seconds with 1 millisecond of run time
between samples
Sampling completed, processing symbols...
Analysis of sampling Python (pid 5635) every 1 millisecond
Call graph:
    2496 Thread_2503
      2496 0x1f84
        2496 Py_Main
          2496 PyRun_SimpleFileExFlags
            2496 PyRun_FileExFlags
              2496 PyErr_Display
                2496 PyEval_EvalCode
                  2496 PyEval_EvalCodeEx
                    2496 PyEval_EvalFrameEx
                      2496 PyEval_EvalCodeEx
                        2496 PyEval_EvalFrameEx
                          2496 PyEval_EvalCodeEx
                            2496 PyEval_EvalFrameEx
                              2496 PyEval_EvalCodeEx
                                2496 PyEval_EvalFrameEx
                                  2496 PyEval_EvalCodeEx
                                    2496 PyEval_EvalFrameEx
                                      2496 PyAST_FromNode
                                        2496 PyOS_Readline
                                          2496 0x4521e0
                                            2496 select$DARWIN_EXTSN
                                              2496 select$DARWIN_EXTSN

Total number in stack (recursive counted multiple, when >=5):
        5       PyEval_EvalCodeEx
        5       PyEval_EvalFrameEx

Sort by top of stack, same collapsed (when >= 5):
        select$DARWIN_EXTSN        2496
Sample analysis of process 5635 written to file /dev/stdout

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
John Hunter | 3 Dec 04:44
Picon
Gravatar

Re: hist() hangs on OSX 10.5

On Dec 2, 2007 9:23 PM, Chris Fonnesbeck <listservs@...> wrote:
> Running a recent build from svn on OSX 10.5, the TkAgg interface
> becomes unresponsive after plotting a histogram and calling show().
> Here is a sample from the process, in case it is useful:

I'm not seeing this with tkagg on 10.5.  hist is working fine for me
both in ipython and running histogram_demo.py -- what tcl/tk are you
building against?

For reference,  I'm attaching my build output.  My build notes are at
http://ipython.scipy.org/moin/Py4Science/InstallationOSX.  Let me know
if any substantive differences leap out at you.

JDH
Attachment (build.out): application/octet-stream, 107 KiB
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Dirk Zickermann | 3 Dec 11:57

colored histogram

Dear users,
I would like to generate a colored histogram using a colormap.
via
...
vals, bins, patchs = pylab.hist(hist_data ,75 ,normed=1)
..
Does anybody know how to assign a colormap to a histogram to find map data so that one can find easily data from a 2d map in the histogram?

Thanks a lot,
dirk

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Gmane