Newbie / plot([1,2,3]) issues / Csound

Hi Folks,

I've been using Python about 9 months or so, inspired mainly by the desire
to work more effectively with Csound. Python has been a revelation to my
creativity & music making ambitions, & probably the most satisfying &
consuming creative diversion i have ever made.

Ive today installed Numpy & Matplotlib (on XP), & set TKagg as my backend in
the matplotlibrc file.

When i try & run the plot([1,2,3]) example (im working from the matplotlib
user guide pdf document, which generally looks very nice, much like
matplotlib itself dare i say..) a TK window opens, but nothing appears in
it, the hourglass continues ad infinitum, & the process eventually hangs.

This also happened when i ran IDLE from the command line (something i'd
never done before) with the -n flag...

Idle's window tells me that an output plot object was sucessfully created
however...

So, err, what could the problem be? I'm using standard windows binary
installers for everything, Python 2.5, Numpy 1.0.3.1, Matplotlib 0.91.2.
Everything imports ok.

On a less immediate note, i would like to address people to this post i made
earlier today on the Tkinter list

http://www.nabble.com/drawing-multiple-functions-on-the-canvas-td16064458.html

for some advice &/or assistance. Whilst i can see Matplotlib as being useful
to my DSP & musicmaking world in a number of adhoc ways, i'm primarily
interested in trying to find shortcuts & methods to defining "arbitrary"
functions with the mouse(/wacom) input, recording the x/y(/z) data into an
array, & refreshing / displaying that data to the screen.

There seems to be plenty around to help me scribble on a canvas, but not in
a way that allows me to keep unique, "function" like, myfunc[x] = y lists &
display them to screen.

I've been aware for awhile now that Matplotlib may offer me some elegant &
more than adequate solutions to displaying mathematically defined functions,
but can it help me design by hand & output overlays of arbitrary xy patterns
& relationships at all?

All i would need to do is then output my input created XY arrays / lists to
.txt file, & bring the data into my existing Python / Csound environment for
immediate & easy use.

So if anyone has any advice on the simplest, lowlevel way i might go about
attempting this (with or without Matplotlib) that'd be ace. But essentially
i am talking about displaying & refreshing plots after all, right? so
hopefully this is a good place to start.

Spoilt for choice, swamped by info, uncertain how best to proceed.

many thanks

Tim

···

-----
*******************
www.phasetransitions.net
hermetic music * python * csound * possibly mindless ranting
various werk in perpetual delusions of progress....


View this message in context: http://www.nabble.com/Newbie---plot(-1%2C2%2C3-)-issues---Csound-tp16065553p16065553.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Would you set "verbose.level : debug" in your matplotlibrc, try again, and
post the output?

···

On Saturday 15 March 2008 4:06:39 am Tim Mortimer wrote:

Hi Folks,

I've been using Python about 9 months or so, inspired mainly by the desire
to work more effectively with Csound. Python has been a revelation to my
creativity & music making ambitions, & probably the most satisfying &
consuming creative diversion i have ever made.

Ive today installed Numpy & Matplotlib (on XP), & set TKagg as my backend
in the matplotlibrc file.

When i try & run the plot([1,2,3]) example (im working from the matplotlib
user guide pdf document, which generally looks very nice, much like
matplotlib itself dare i say..) a TK window opens, but nothing appears in
it, the hourglass continues ad infinitum, & the process eventually hangs.

This also happened when i ran IDLE from the command line (something i'd
never done before) with the -n flag...

Idle's window tells me that an output plot object was sucessfully created
however...

So, err, what could the problem be?

Thanks Darren,

Here's a copy of what IDLE is printing to the screen (i'm using idle because
I'm lazy & don't like typing filepaths in full ; ) - a lot of my python
stuff is about avoiding doing exactly this for csound repeatedly... )

There's nothing specific re the Tk window crash that i can see

Many other .py matplotlib examples I have tried work - just (so far) not the

plot([1,2,3])

command, nor Anim.py that i have taken from the distributed examples zip.

In the case of Anim.py, the window launches & displays the animation
sucessfully - however any attempt at window interaction results in hang &
crash.

My hunch is the problem is Tk(?), not Matplotlib.

I have to admit, the font choice seems like an unusual / unexpected one (see
below)

Anyway, thanks for taking a look, & please advice if anything you see below
is illuminating on any issue at all.

from pylab import *

loaded rc file
C:\Python25\lib\site-packages\matplotlib\mpl-data\matplotlibrc
matplotlib version 0.91.2
verbose.level debug
interactive is True
units is False
platform is win32
loaded modules: ['pylab', '_bisect', 'xml.sax.urlparse', 'distutils',
'tkFileDialog', 'random', 'datetime', 'idlelib.macosxSupport',
'matplotlib.tempfile', 'distutils.sysconfig', 'encodings.encodings',
'pytz.cStringIO', 'xml', 'struct', 'tempfile', 'xml.sax.urllib',
'pytz.tzinfo', 'idlelib.cPickle', 'matplotlib.__future__', 'imp',
'collections', 'idlelib.MultiCall', 'pytz.os', 'zipimport', 'string',
'SocketServer', 'repr', 'idlelib.string', 'idlelib.bdb', 'pytz.datetime',
'itertools', 'distutils.re', 'idlelib.SocketServer', 'ConfigParser',
'bisect', 'signal', 'idlelib.IOBinding', 'xml.sax.types', 'threading',
'tkMessageBox', 'idlelib.warnings', 'xml.sax.xmlreader', 'matplotlib.pytz',
'idlelib.struct', 'idlelib.cStringIO', 'idlelib.linecache', 'locale',
'idlelib.threading', 'idlelib.TreeWidget', 'idlelib.rpc', 'idlelib.re',
'encodings', 'idlelib.RemoteDebugger', 'idlelib.tempfile', 'shutil',
'dateutil', 'idlelib.codecs', '_tkinter', 'bdb', 'matplotlib.warnings',
'matplotlib.string', 'pytz.pytz', 'urllib', 'matplotlib.sys', 're',
'idlelib.RemoteObjectBrowser', 'ntpath', 'idlelib.imp', 'idlelib.locale',
'idlelib.thread', 'math', 'idlelib.Debugger', 'Tkinter',
'idlelib.traceback', 'idlelib.marshal', 'UserDict', 'distutils.os',
'matplotlib', 'Queue', 'idlelib.StackViewer', 'codecs', 'idlelib.copy_reg',
'md5', '_locale', 'idlelib.AutoComplete', 'matplotlib.sre_constants',
'socket', 'thread', 'idlelib.time', 'traceback', 'weakref',
'idlelib.socket', 'idlelib.CallTipWindow', 'os', 'marshal', 'pytz.tzfile',
'__future__', 'nturl2path', 'idlelib.AutoCompleteWindow',
'idlelib.tkFileDialog', 'cStringIO', '_sre', 'xml.sax.sys', '__builtin__',
'matplotlib.copy', 'matplotlib.re', 'operator', 'distutils.string',
'select', 'idlelib.os', 'idlelib.ZoomHeight', 'matplotlib.datetime',
'idlelib.ConfigParser', 'errno', '_socket', 'binascii', 'sre_constants',
'matplotlib.md5', 'types', 'pytz.sys', 'xml.sax.handler',
'idlelib.__builtin__', 'idlelib.tkMessageBox', 'xml.sax.os', 'cPickle',
'matplotlib.xml', 'idlelib.HyperParser', 'encodings.cp1252', 'pytz',
'matplotlib.pyparsing', 'idlelib.repr', 'copy', 'idlelib.Queue', '_struct',
'_types', 'matplotlib.dateutil', 'hashlib', 'keyword', 'idlelib.keyword',
'xml.sax.saxutils', 'idlelib.__main__', 'idlelib.sys', 'encodings.aliases',
'matplotlib.fontconfig_pattern', 'exceptions', 'sre_parse', 'pytz.bisect',
'distutils.distutils', 'FixTk', 'copy_reg', 'sre_compile', 'xml.sax',
'_hashlib', '_random', 'pytz.struct', 'site', 'SimpleDialog', '__main__',
'idlelib.types', 'matplotlib.weakref', 'urlparse', 'tkCommonDialog',
'matplotlib.os', 'strop', 'encodings.codecs', 'gettext', '_codecs',
'matplotlib.rcsetup', 'nt', 'pytz.sets', 'xml.sax._exceptions',
'idlelib.PyParse', 'xml.sax.codecs', 'stat', '_ssl', 'warnings',
'encodings.types', 'sets', 'sys', 'idlelib.Tkinter', 'idlelib.CallTips',
'idlelib.configHandler', 'idlelib.WindowList', 'idlelib.SimpleDialog',
'os.path', 'idlelib.ScrolledList', 'pytz.gettext', 'distutils.sys',
'matplotlib.distutils', '_weakref', 'idlelib.ObjectBrowser', 'idlelib',
'Tkconstants', 'distutils.errors', 'matplotlib.matplotlib', 'linecache',
'matplotlib.shutil', 'time', 'idlelib.select', 'idlelib.run']
numerix numpy 1.0.3.1
$HOME=C:\Documents and Settings\Tim
CONFIGDIR=C:\Documents and Settings\Tim\.matplotlib
Using fontManager instance from C:\Documents and
Settings\Tim\.matplotlib\fontManager.cache
matplotlib data path C:\Python25\lib\site-packages\matplotlib\mpl-data
backend TkAgg version 8.4

plot([1,2,3])

findfont found Bitstream Vera Sans, normal, normal 400, normal, 12.0
findfont returning c:\program
files\celemony\melodyne.3.0\vstplugins\uhe_data\podolski\fonts\vera.ttf
[<matplotlib.lines.Line2D instance at 0x018383A0>]

....cue blank TK window with infinite hourglass....

···

-----
*******************
www.phasetransitions.net
hermetic music * python * csound * possibly mindless ranting
various werk in perpetual delusions of progress....


View this message in context: http://www.nabble.com/Newbie---plot(-1%2C2%2C3-)-issues---Csound-tp16065553p16074266.html
Sent from the matplotlib - users mailing list archive at Nabble.com.