Re: [Matplotlib-users] CVS ?

2007-10-02 Thread Wayne E. Harlan

Eric Firing wrote:
If a straightforward plotting sequence, such as one of the examples, 
does this, then it sounds like a broken installation, not a matplotlib 
bug.



Based on your comment above, here are my particulars:

1)  System is LinuxFromScratch recently built from their SVN book:
   glibc is 2.5, gcc is 4.1.2, X is Xorg 7.2 installed in /usr.

2)  Python 2.5.1 with Tkinter enabled.   If I run the following script, 
I get the 'quit' button which when clicked makes the button/window 
disappear, so I know python and Tkinter are working.


#!/usr/bin/python
from Tkinter import *
class Application(Frame):
   def __init__(self, master=None):
   Frame.__init__(self, master)
   self.grid()
   self.createWidgets()
   def createWidgets(self):
   self.quitButton = Button ( self, text="Quit",command=self.quit )
   self.quitButton.grid()
app = Application()
app.master.title("Sample application")
app.mainloop()

3)  Numpy 1.0.3.1 installed without any errors and I can do the following:

>>> import numpy
>>> List = dir(numpy)
>>> len(List)
491
>>>

4)  Matplotlib 0.90.1 also installed without error.  I set 
BUILD_TKAGG   = 1 which may not have been necessary, but it seems to 
have worked since in my matplotlibrc file I find "backend  : 
TkAgg".  Then if I do this
" python simple_plot.py --verbose-debug",  I get the output in the 
simple_output attachment.  The font errors there are the same as what I 
get in each of my 3 XP installations where matplotlib works just fine, 
so I don't think they are the cause of the segfault.  As I may have 
described previously, the plot window appears for a fraction of a second 
and then disappears as the segfault occurs.


I also ran "strace python simple_plot.py --verbose-debug" with the 
output that's in the strace_output attachment to see if that would give 
any more information but that output ends at the segfault and I am not 
knowledgeable enough to understand what it says.


Any help will be appreciated.

Best Regards,

Wayne

[EMAIL PROTECTED] ~/Programming/Python/matplotlib/examples: python 
simple_plot.py --verbose-debug  
matplotlib data path /usr/lib/python2.5/site-packages/matplotlib/mpl-data
$HOME=/home/wayne
CONFIGDIR=/home/wayne/.matplotlib
loaded rc file /home/wayne/.matplotlib/matplotlibrc
matplotlib version 0.90.1
verbose.level debug
interactive is False
units is True
platform is linux2
loaded modules: ['pylab', 'distutils.distutils', '_bisect', '__future__', 
'copy_reg',
 'sre_compile', 'distutils', 'itertools', '_hashlib', '_sre', '__main__', 
'site', '__
builtin__', 'datetime', 'matplotlib.re', 'matplotlib.tempfile', 'encodings', 
'encodin
gs.encodings', 'shutil', 'distutils.string', 'dateutil', 'matplotlib.datetime', 
'posi
xpath', '_random', 'tempfile', 'errno', 'matplotlib.warnings', 'binascii', 
'encodings
.codecs', 'sre_constants', 're', 'matplotlib.md5', 'os.path', 'pytz.sys', 
'_codecs', 
'distutils.sysconfig', 'pytz.sets', 'math', 'fcntl', 'stat', 'zipimport', 
'string', '
warnings', 'encodings.types', 'UserDict', 'encodings.ascii', 'matplotlib.sys', 
'matpl
otlib', 'distutils.os', 'sys', 'pytz.tzinfo', 'pytz', 'pytz.datetime', 
'matplotlib.__
future__', 'codecs', 'distutils.re', 'matplotlib.pytz', 'types', 'md5', 
'_types', 'ma
tplotlib.dateutil', 'hashlib', 'matplotlib.os', 'thread', 'bisect', 
'matplotlib.distu
tils', 'signal', 'distutils.errors', 'random', 'linecache', 
'matplotlib.shutil', 'pos
ix', 'encodings.aliases', 'sets', 'exceptions', 'sre_parse', 'pytz.bisect', 
'distutil
s.sys', 'os', 'strop']
numerix numpy 1.0.3.1
font search path 
['/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf', '
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/afm']
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/VeraMo
BI.ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/VeraSe
.ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmmi10
.ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/VeraSe
Bd.ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmsy10
.ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/VeraIt
.ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmr10.
ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmex10
.ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/cmtt10
.ttf
trying fontname 
/usr/lib/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf/Vera.t
tf
loaded ttfcache file /home/wayne/.matplotlib/ttffont.cache
backend TkAgg version 8.4
findfont failed Bitstream Vera Serif, New Century Schoolbook, Century 
Schoolb
ook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, 
Times, Pala
tino, Charter, serif
Could not match Bitstream Vera Serif, New Century Schoolbook

Re: [Matplotlib-users] Plot array of arrays

2007-10-02 Thread David D Clark
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Alan,

Thanks for the help.  This was a big clue.  It turns out that what I
thought was an array of arrays was actually a list of arrays.  If my
list was y, running plot(x,array(y).transpose()) solved the problem!

Thanks for your help,
Dave

Alan G Isaac wrote:
> On Mon, 01 Oct 2007, David D Clark apparently wrote:
>> y=[array([]),array([]),array([])...] 
>> and x=array([x0,x1,x2,...])
> 
>> I want to plot the family of curves y=f(x). 
>> plot(x,y[n]) where n is the nth array in y plots the correct curve, 
>> however plot(x,y) and plot(x,y[:]) complain about mismatched array 
>> dimensions. 
> 
> 
> Might you want
> plot(x,y.transpose())
> 
> hth,
> Alan Isaac
> 
> 
> 
> 
> -
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

- --
David D. Clark
Electrical Engineer
P-23, Neutron Science and Technology
e-mail mailto:[EMAIL PROTECTED]
GPG Public key 0x018D6523 available at http://pgp.mit.edu
http://www.gnupg.org has information about public key cryptography
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFHAoCvNu7GcwGNZSMRAmlVAJ46vuGaTNmGg0GDvPY7FzAdWhk9sACeIWpY
i12r6Utl4pLzyabsxCCP+Dw=
=jWKL
-END PGP SIGNATURE-

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib.mlab.psd: zero padding + detrending

2007-10-02 Thread Eric Firing
John Hunter wrote:
> On 10/2/07, Lars Friedrich <[EMAIL PROTECTED]> wrote:
>> Hello all,
>>
>> I am using matplotlib.mlab.psd to find power spectra of measured data.
>> Sometimes it happens that I use the automatic zero padding (if the
>> length of my measured data is smaller than nFFT) and detrending
>> (pylab.detrend_mean) at the same time.
>>
>> I think that the psd-algorithm does the zero padding *first* and *then*
>> uses the detrend function.
>>
>> For my application this is not good because it introduces low-frequency
>> signals that I can see in the spectrum. So the detrending does not work
>> as good as it does when there is no zero padding.
>>
>> What is the reason for this order of applying zero padding and
>> detrending? Wouldn't it make sense to change it?
> 
> I wrote this function many years ago and do not remember why I choose
> the order pad then detrend, but what you propose makes sense, so let's
> let this percolate for a bit and if noone objects I will change it
> (and related functions).

The change makes sense to me also.

Eric

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib.mlab.psd: zero padding + detrending

2007-10-02 Thread John Hunter
On 10/2/07, Lars Friedrich <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I am using matplotlib.mlab.psd to find power spectra of measured data.
> Sometimes it happens that I use the automatic zero padding (if the
> length of my measured data is smaller than nFFT) and detrending
> (pylab.detrend_mean) at the same time.
>
> I think that the psd-algorithm does the zero padding *first* and *then*
> uses the detrend function.
>
> For my application this is not good because it introduces low-frequency
> signals that I can see in the spectrum. So the detrending does not work
> as good as it does when there is no zero padding.
>
> What is the reason for this order of applying zero padding and
> detrending? Wouldn't it make sense to change it?

I wrote this function many years ago and do not remember why I choose
the order pad then detrend, but what you propose makes sense, so let's
let this percolate for a bit and if noone objects I will change it
(and related functions).

JDH

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib.mlab.psd: zero padding + detrending

2007-10-02 Thread Lars Friedrich
Hello all,

I am using matplotlib.mlab.psd to find power spectra of measured data. 
Sometimes it happens that I use the automatic zero padding (if the 
length of my measured data is smaller than nFFT) and detrending 
(pylab.detrend_mean) at the same time.

I think that the psd-algorithm does the zero padding *first* and *then* 
uses the detrend function.

For my application this is not good because it introduces low-frequency 
signals that I can see in the spectrum. So the detrending does not work 
as good as it does when there is no zero padding.

What is the reason for this order of applying zero padding and 
detrending? Wouldn't it make sense to change it?

Thanks
Lars

-- 
Dipl.-Ing. Lars Friedrich

Photonic Measurement Technology
Department of Microsystems Engineering -- IMTEK
University of Freiburg
Georges-Köhler-Allee 102
D-79110 Freiburg
Germany

phone: +49-761-203-7531
fax:   +49-761-203-7537
room:  01 088
email: [EMAIL PROTECTED]

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Non-interactive use always tries to load wx

2007-10-02 Thread Eric Firing
Daniel O'Connor wrote:
> Hi,
> I am trying to use matplotlib non-interactively but if I don't have
> DISPLAY set then wx barfs even though I have tried forcing the backend,
> etc..

This is characteristic of matplotlib that I think should be considered a 
major bug, but I have not gotten around to fixing it: you have to call 
matplotlib.use() *before* importing pylab for it to have any effect.  If 
you call it after the first import of pylab, it is silently ineffective, 
hence highly misleading. Many people are caught by this "gotcha".

I will fix this shortly by making matplotlib.use() raise an exception if 
matplotlib.backends has already been loaded.

Eric

> 
> eg..
> [midget 16:51] ~/projects/beermon >python
> Python 2.5.1 (r251:54863, Aug 14 2007, 11:27:14)
> [GCC 3.4.6 [FreeBSD] 20060305] on freebsd6
> Type "help", "copyright", "credits" or "license" for more information.
 import pylab, matplotlib
> matplotlib.use>>> matplotlib.use('agg')
 fig = pylab.figure()
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "/usr/local/lib/python2.5/site-packages/matplotlib/pylab.py", line 
> 859, in figure
> figManager = new_figure_manager(num, figsize=figsize, dpi=dpi, 
> facecolor=facecolor, edgecolor=edgecolor, frameon=frameon, 
> FigureClass=FigureClass, **kwargs)
>   File 
> "/usr/local/lib/python2.5/site-packages/matplotlib/backends/backend_wxagg.py",
>  line 134, in new_figure_manager
> backend_wx.wxapp = wx.PySimpleApp()
>   File 
> "/usr/local/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", 
> line 7791, in __init__
> wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
>   File 
> "/usr/local/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", 
> line 7700, in __init__
> self._BootstrapApp()
>   File 
> "/usr/local/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", 
> line 7352, in _BootstrapApp
> return _core_.PyApp__BootstrapApp(*args, **kwargs)
> SystemError: wxEntryStart failed, unable to initialize wxWidgets!  (Is 
> DISPLAY set properly?)
> 
> Same problem if I try Cairo.
> I had a google but no luck, can anyone help me out?
> 
> Thanks.
> 
> 
> 
> 
> 
> -
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
> 
> 
> 
> 
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Non-interactive use always tries to load wx

2007-10-02 Thread Daniel O'Connor
On Tue, 2 Oct 2007, Jouni K. Seppänen wrote:
> "Daniel O'Connor" <[EMAIL PROTECTED]> writes:
> > I am trying to use matplotlib non-interactively but if I don't have
> > DISPLAY set then wx barfs even though I have tried forcing the
> > backend, etc..
>
> This should probably be in the FAQ... you need to set the backend
> before you import pylab, because importing pylab reads your
> matplotlibrc file and does all sorts of setup:
>
> import matplotlib
> matplotlib.use('agg')
> import pylab

Ahah, thanks - works much better now, I wondered why I couldn't affect 
the backend :)

In the FAQ would be very nice!

PS thanks to all the devs for matplotlib, it is very useful!

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C


signature.asc
Description: This is a digitally signed message part.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Non-interactive use always tries to load wx

2007-10-02 Thread Jouni K . Seppänen
"Daniel O'Connor" <[EMAIL PROTECTED]> writes:

> I am trying to use matplotlib non-interactively but if I don't have
> DISPLAY set then wx barfs even though I have tried forcing the backend,
> etc..

This should probably be in the FAQ... you need to set the backend before
you import pylab, because importing pylab reads your matplotlibrc file
and does all sorts of setup:

import matplotlib
matplotlib.use('agg')
import pylab

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CVS ?

2007-10-02 Thread Eric Firing
Wayne E. Harlan wrote:
> I have a serious problem with my Linux installation of matplotlib.  It 
> segfaults after a very brief display of a plot window outline (no actual 
> plot within it).  Before presenting the details of my problem, I would 

If a straightforward plotting sequence, such as one of the examples, 
does this, then it sounds like a broken installation, not a matplotlib bug.

> like to download the latest CVS version to make sure this hasn't been 
> fixed already, however I cannot find any references to CVS in any of the 
> Matplotlib web pages, except for a reference for it in one of the recent 
> emails in this list.  How do I find it ?

See the following:

http://sourceforge.net/svn/?group_id=80706

We are using subversion, not cvs.

Eric

> 
> Thanks in advance,
> 
> Wayne

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Non-interactive use always tries to load wx

2007-10-02 Thread Daniel O'Connor
Hi,
I am trying to use matplotlib non-interactively but if I don't have
DISPLAY set then wx barfs even though I have tried forcing the backend,
etc..

eg..
[midget 16:51] ~/projects/beermon >python
Python 2.5.1 (r251:54863, Aug 14 2007, 11:27:14)
[GCC 3.4.6 [FreeBSD] 20060305] on freebsd6
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylab, matplotlib
matplotlib.use>>> matplotlib.use('agg')
>>> fig = pylab.figure()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python2.5/site-packages/matplotlib/pylab.py", line 859, 
in figure
figManager = new_figure_manager(num, figsize=figsize, dpi=dpi, 
facecolor=facecolor, edgecolor=edgecolor, frameon=frameon, 
FigureClass=FigureClass, **kwargs)
  File 
"/usr/local/lib/python2.5/site-packages/matplotlib/backends/backend_wxagg.py", 
line 134, in new_figure_manager
backend_wx.wxapp = wx.PySimpleApp()
  File 
"/usr/local/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line 
7791, in __init__
wx.App.__init__(self, redirect, filename, useBestVisual, clearSigInt)
  File 
"/usr/local/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line 
7700, in __init__
self._BootstrapApp()
  File 
"/usr/local/lib/python2.5/site-packages/wx-2.6-gtk2-unicode/wx/_core.py", line 
7352, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
SystemError: wxEntryStart failed, unable to initialize wxWidgets!  (Is DISPLAY 
set properly?)

Same problem if I try Cairo.
I had a google but no luck, can anyone help me out?

Thanks.

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C


signature.asc
Description: This is a digitally signed message part.
-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users