[Matplotlib-users] editor ?

2008-01-21 Thread Giorgio . Luciano
I was just wondering if there is any editor for the figures done in 
matplotlib. I mean something like the matlab(TM) figure or esayplot for 
QToctave. Since I use a software that use embedded matplotlib and after 
having the plot it could be very helpful to have somthing that can help 
tweaking the figure without using command line
Thanks in advance for every hints/suggestion
Giorgio-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
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] gscatter

2008-01-10 Thread Giorgio . Luciano
I was wondering if there exist a functino like Matlab (TM) gscatter in 
matplot lib but I coulnd't find one.
I also seen that in matplot lib we are limited to 10 symbols in scatter 
while in MT we have 13 (and I have to plot 12 :)))
is it possible to implement the new function (gscatter) and other symbols 
;)
thanks
Giorgio
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] (no subject)

2007-10-29 Thread Giorgio . Luciano
Dear all,
is there the possiblity  in matplolib to buind dendograms ?
I've searched a bit bout found no examples of it it seems not implemented
is there a plan for doing it ?
Thanks in advance for all reply
Giorgio-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now  http://get.splunk.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] signal processing chapter for book

2007-06-04 Thread Giorgio Luciano
first of all sorry for cross posting
As I wrote some time ago we are trying to write a book proposal about 
the use of python/scipy/numpy in chemometrics and analytical chemistry. 
Since now I've received positive answer from eight authors and the only 
missing chapter is one about the use of python in digital signal 
processing (I've contacted some possible authors but since now they are 
busy).
The schedule will not too tight and the chapter doesnt' need to be too long.
Hope to hear from you soon
Giorgio

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] call for chapeters in a book about freeware/opensource in chemometrics

2007-05-15 Thread Giorgio Luciano
Dear All,
me and other two colleagues will be interested in writing a tutorial 
book about the use of opensource/freeware software in chemometrics 
(mainly python oriented).
I've contacted the editor at Blackwell publishing that has told me that 
can be interested in it and sent me the module for submitting the 
official proposal.
I will be very glad to hear from everyone that would like to write a 
chapter on it.
In my opinion it will be the best to have a book with lots of examples 
that covers simple task, but i will be also glad if anyone would like 
to write tutorial chapter of less commons subjects.
for any feedback just write to me
I guess this can be both a change for spread the word of 
opensouce/freeware togheter with chemometrics also to let know the 
audience that it's not necessary to invest a lot of money in software 
for working in chemometrics.
Of course, since there are not too much freeware/opensource software in 
the field, it can be a chance to advertise personal built-in software 
and to start something new.
I hope to receive help and I will be glad to talk with enthusiast all around

Giorgio

P.S.: (sorry for cross posting)


-- 
-==-
Dr Giorgio Luciano Ph.D.
Di.C.T.F.A. Dipartimento di Chimica e Tecnologie Farmaceutiche e Alimentari
Via Brigata Salerno (ponte) - 16147 Genova (GE) - Italy
email [EMAIL PROTECTED]
www.chemometrics.it
-==-


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] use of enthought Python for matplotlib/numpy

2007-05-11 Thread Giorgio Luciano
I would add one box of donuts, since I'm trying to make my own 
distribution with numpy/scipy/matplotlib but with no success.
and the problem is the same is for a classroom ;) If anyone knows also a 
portable distribution with this package I will add extra donuts ;)

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib and py2exe

2007-04-03 Thread Giorgio Luciano
I tried to compile the file and it seems to work (send by Werner).
I'm also interested in the problem since I cannot succeed in compiling 
too with matplotlib (already followed the instruction found on py2exe)  
Hope to see how it develop and happy to know if anyone succeed in doing it
Giorgio
   

-
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.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib and py2exe

2007-04-03 Thread Giorgio Luciano
Hello Werner,
here is the file I try to compile.
It gave an error of missing DLL when i try to launch :(
no Idea why, since with you example everything works
(I'm using maplotlib 0.87.7)

Giorgio



import pylab as pyl
from scipy import *
from pyautosct import *
x=pyl.load('c:/temp/iris.txt')
#def pynipals
#return (lmat,smat,qcont,tcont,smat2,qcont2,tcont2)
[o,c]=x.shape
aut=raw_input('Autoscale data [y] or [n] ?')
# Start of autoscaling
if aut=='y':
 vard=var(x,axis=0)*(o/(o-1.0))
 stdn=sqrt(vard)# it differs from std in Matlab(tm) where  std is normalised
 stdon=ones((o,1))*stdn
 xmeann=ones((o,1))*x.mean(axis=0)
 xnorm=(x-xmeann)/stdon
 x=xnorm
# End of autoscaling
smat=zeros((o,c))
lmat=zeros((c,c))
xt=x
if oc:
 vp=zeros((1,o))
 varexp=zeros((1,o))
else:
 vp=zeros((1,c))
 varexp=zeros((1,c))
t=0
vartot=(x**2).sum()
sts=raw_input('Variance to be retained (max 99) ?')
st=int(sts)
st=round(st,1)
while vp.sum()st:
 t=t+1
 ss=(x**2).sum(axis=0)
 #ss=round_(ss, decimals=8)
 a=sort(ss)
 b=ss.argsort(kind='merge')
 xmax=xt[:,b[c-1]]
 s=(xmax*xmax).sum()
 diffi=1000
 while diffi0.001:
  rmax=dot(xmax,xt)/s
  rmaxsq=(rmax*rmax).sum()
  rmax=rmax/sqrt(rmaxsq)
  xmax=dot(xt,rmax)
  s2=(xmax*xmax).sum()
  diffi=abs(s2-s)
  s=s2  
 smat[:,t-1]=xmax
 lmat[t-1,:]=rmax
 varexp[0,t-1]=(xmax*xmax).sum()
 vp[0,t-1]=varexp[0,t-1]/vartot*100
 xmaxc=xmax[:,pyl.NewAxis]
 xt=xt-xmaxc*rmax
print vp
print diffi
ncs=raw_input('How many components ?')
nc=int(ncs)
lmat=lmat[arange(0,nc),:]
smat=smat[:,arange(0,nc)]
[a,b]=smat.shape
# Computation of T2 values
t2=zeros((o,1))
vvv=zeros((nc,nc))
for i in arange(1,nc+1):
 vvv[i-1,i-1]=varexp[0,i-1]/(o-1)
for i in arange(1,o+1):
 t2[i-1]= 
dot(dot(smat[i-1,arange(0,nc)],linalg.inv(vvv)),smat[i-1,arange(0,nc)])
### T2 contributions
ssq=empty((nc,1))
for i in arange(1,nc+1): 
  ssq[i-1,0]=vvv[i-1,i-1]
h=(1./sqrt(ssq))
k=h[:,0]
#it has to be a vector before using diag
tcont=dot(dot(dot(x,lmat.transpose()),diag((k))),lmat)
#Comparison with matlab -= ok =-
# Computation of Q values based on cross-validation (ng deletion groups)
ng=5;
q=zeros((o,1))
qcont=zeros((o,c))
for g in arange(1,ng+1):
 t=arange(g,o+1,ng)
 smattr=zeros((o,c))
 lmattr=zeros((c,c))
 xtr=x;
 xtr=delete(xtr,t-1, axis=0)
 xev=x[t-1,:]
 [rtr,c]=xtr.shape
 if aut=='y':
  sst=diag(ones((rtr,1))*std(xtr,axis=0)*sqrt((rtr/(rtr-1.0
  jj1=min(sst)
  jj2=argmin(sst)
  if jj1==0:
   print 'Error: variable ', int(jj2), ' constant in group ', int(g)
  aa=pyautosct(xtr,xev)
  xtr=aa[arange(0,rtr),:]
  [aah,aak]=aa.shape
  xev=aa[arange(rtr,size(aa,0)),:]
#Comparison with matlab -= ok =-
 xttr=xtr
 [ttrh,ttrk]=xttr.shape
 tt=0
##checked
 while ttnc:
  smattr=zeros((ttrh,nc))
  lmattr=zeros((nc,c))
  tt=tt+1
  ss=(xttr**2).sum(axis=0)
  a2=sort(ss)
  b2=ss.argsort(kind='merge')
  xmax=xttr[:,b2[c-1]]
  s=(xmax*xmax).sum()
 ##checked
  diffi=1000
  while diffi0.001:
   rmax=dot(xmax,xttr)/s
   rmaxsq=(rmax*rmax).sum()
   rmax=rmax/sqrt(rmaxsq)
   xmax=dot(xttr,rmax)
   s2=(xmax*xmax).sum()
   diffi=abs(s2-s)
   s=s2
  ##checked
  smattr[:,tt-1]=xmax
  lmattr[tt-1,:]=rmax
  xmaxc=xmax[:,pyl.NewAxis]
  xttr=xttr-xmaxc*rmax
 smatev=dot(xev,lmattr.transpose())
 reconstrev=dot(smatev,lmattr)
 for i in arange(1,size(xev,0)+1):
  tind=t-1
  
q[tind[i-1]]=((reconstrev[i-1,:]-xev[i-1,:])*(reconstrev[i-1,:]-xev[i-1,:])).sum()
  qcont[tind[i-1]]=(reconstrev[i-1,:]-xev[i-1,:])**2
print 'smat'
print smat
print 'lmat'
print lmat
print 'tcont'
print tcont
print 'qcont'
print qcont


-
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.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] question about standalone small software and teaching

2007-04-03 Thread Giorgio Luciano
Hello Dear All,
I just have a question for all that  uses python/numpy/scipy/matplotlib 
for making science.
I use with no problem in my computer  python+numpy+scipy+matplotlib and 
I'm very satisfied with them.
I was a matlab user. I still not have unearthed the power ot python but 
I'm happy to use a programming language and not a metalanguage. When I 
gave people my software (in matlab) the all ask me if I could compile 
and create some interface.
I tried to use matlab GUIs, succeded in creating, but then I had a lot 
of problems. Compiling not always worked. after compiling you have not a 
workspace and so I had to make all output as txt files... and so on.
Now that I use python I'm again with the same problem. I create easy 
routines (for chemometrics) and then people ask me if I can make a 
standalone program with interface.
I used orange and for NN it's surely one of the best, but I'm not good 
at programming widgets. Then I think about it, searched the web and 
didn't find anything.
What I'm searching is something similar to labview :)
At first I thought ... hey why people wat an interface, just use the 
console, and then after listening  to their reason I have to agree.
What do I generally do ? I have a matrix in txt, I apply my routines (a 
SVD, a PCA, a filter etc etc  written in python), plot them (using 
maplotlib) and then I want an output. that's it.
I started looking at various Qt etc. etc. but for me it's overhelming, 
because I think that the most important part should be dedicate to the 
routines creation and not to making a gui, compiling, etc. etc. I need 
simple command like people wants. grids, paste and copy, small working 
plots :)
I mean I can get crazy with setting my program, importing etc. etc. but 
I also have to say that needs and claim about writing simple guis, 
common paste and copy etc should be considered from someone there (we 
wait for the help of some guru that makes things easier ;)

thanks for reading the mail
Giorgio


-
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.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matlab, idle, interactivity and teaching

2007-04-02 Thread Giorgio Luciano
Thank for all the reply.
I will sure have a look at the video that Oliver suggest and I also 
downloaded Eclipse.
I'm happy that someone also shared my problems in teaching python.
I'm aware that python/scipy were not started as a clone matlab (well 
matlibplot was started as something similar ;)
and also that they should be taught as an language (and that's why I 
prefer to use it an not to shol very useful programs like OCTAVE od 
Scilab.. it's better for students to hava a curriculum with a true 
programming language than with a metalanguage).
I have to admit also that if someone there sooner or later would create 
a workspace similar to matlab (with paste and copy, and more interactive 
feature without tweaking too much) a lot more people would be glade to 
replace their matlab with scipy/matplotlib.

Giorgio

-
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.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Very odd problem of installation of matplotlib/numpy on XP

2007-03-30 Thread Giorgio Luciano
No any other with the same problem :( ?


-
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.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Very odd problem of installation of matplotlib/numpy on XP

2007-03-29 Thread Giorgio Luciano
I've installed in my machine in the following order
python 2.5
numpy 1.01
matplot lib 0.87
scipy 0.52
wxPython 2.8
with no problem
I've also installed the same packages at home and in another two 
computer and everything went fine.
The I was asked to install this configuaration in some classroom 
machines and also on another computer and I continue getting this error

The import of the numpy version of the _transforms module,
_ns_transforms, failed.  This is is either because numpy was
unavailable when matplotlib was compiled, because a dependency of
_ns_transforms could not be satisfied, or because the build flag for
this module was turned off in setup.py.  If it appears that
_ns_transforms was not built, make sure you have a working copy of
numpy and then re-install matplotlib. Otherwise, the following
traceback gives more details:


Traceback (most recent call last):
  File pyshell#2, line 1, in module
from pylab import *
  File C:\Python25\Lib\site-packages\pylab.py, line 1, in module
from matplotlib.pylab import *
  File C:\Python25\Lib\site-packages\matplotlib\pylab.py, line 201, in 
module
from axes import Axes, PolarAxes
  File C:\Python25\Lib\site-packages\matplotlib\axes.py, line 14, in 
module
from artist import Artist, setp
  File C:\Python25\Lib\site-packages\matplotlib\artist.py, line 4, in 
module
from transforms import identity_transform
  File C:\Python25\Lib\site-packages\matplotlib\transforms.py, line 
223, in module
from _transforms import Value, Point, Interval, Bbox, Affine
  File C:\Python25\Lib\site-packages\matplotlib\_transforms.py, line 
17, in module
from matplotlib._ns_transforms import *
ImportError: DLL load failed: Impossibile trovare il modulo specificato

but I can assure that If I check numpy installation before installing  
matplot lib it seems everything fine.
All computer have Windows XP home edition 2002 SP2
the only difference is in the RAM quantity. (more than 256 in the 
computer where everything works) but it seems so strange to me that it 
is the ram (I've also installed in another computer , old one, and 
everything works)
Any IDEA 

Thanks in advance for any suggestion
Giorgio


-
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.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matlab, idle, interactivity and teaching

2007-03-28 Thread Giorgio Luciano
Hello to all,
I've thread that apperead some time ago on this list about matlab and 
teaching.
I've discovered python recently  and translated part of the routine I 
use in python (www.chemometrics.it).
Some of my collegue asked me if I could show them how to use python. For 
matlab user I guess the first problem is to setup everything, but I just 
fixed it preparing a directory with all the package I need and a 
matplotlibrc file for interactive mode + a shortcut for idle -n use.
The second problem is that people now  wants some bells and whistles of 
matlab that I have to admit sometime can be very helpful for saving 
time. The bells and whistles are about the workspace.
It's difficult to cut and paste from gnumeric/excel (I generally use txt 
file but it's no so immediate) and also there is no visual workspace. 
I cannot succeed also in saving workspace (I know there is a function so 
iosave.mat but I didn't manage easily hot to use it)
For overpass this problems I've tried to use QME-DEV which is in early 
stage of development (alpha) but promise well.
What people like of python/matplot/scipy
-its free ;)
-they like a lot the plotting style and capabilities (they find the png 
and svg file very clear and accurate)
-they like IDLE as editor (ehy it's has the same color of matlab ;) ! )

So my question is . Do you have a similar experience ?
How do you help people in moving the first step ?
do you use (and also does it exist) a more friendly environment than 
IDLE except from QME-DEV.

I know that this question may look silly, but in my opinion also how 
much is user friendly a software is very important for getting new users.
Cheers to all
Giorgio



-
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.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Clipborad more friendly tha IDE

2007-02-23 Thread Giorgio Luciano
Sorry for the easy question, I've searched the web but find nothing 
really helpful.
Is there some editor more user friendly for Windows to have a workspace 
where to copy and paste from gnumeric/excel like the matlab workspace
I'm using orange, which is wonderful, but if you have a lot of array to 
copy and paste is not so comfortable as a simple command
line x=[(ctrl+v)]
Thanks in advance to all.
I guess that a workspace like matlab for numpy/scipy will make a lot of 
people to switch more easily form matlab :)))
Giorgio


-
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.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] IDLE, matplotlib and show command

2007-01-02 Thread Giorgio Luciano
I've seen that it also works with
WxAgg version 2.8.0.1 for python 2.5
I hope this information can be useful
Giorgio


-
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.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] IDLE, matplotlib and show command

2006-12-21 Thread Giorgio Luciano
I've searched a bit in the FAQ, since in the last days I'm struggling 
with the show and close command.
I've got a function that calculate values to plot. I calculate plot, use 
show command and everything goes fine.
I close the figure recalculate values and then replot and everything 
freezes because the show command seems still active.
I've tried to start IDLE using -n option but no solution. the plots 
freezes and I loose all calculations, and then I have to restart. reload 
etc..
I tried also to turn interactive off but no way of solving.

I'm using WIN XP
python 2.5
numpy 1.01
scipy 0.52
matplotlib 0.87.7

and I don't want to come back to matlab :) Since in matlab it's very 
common to calculate something, recalculate, plot etc. etc.

Any help would be very appreciated.
If needed I can post function and file I'm using in .tar
Giorgio



-
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.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [problems with closing figure, memory problem ?]

2006-12-20 Thread Giorgio Luciano
I've succeded in solving the problem that seems due to usage of show.
Both of the function i called had a show function enabled that seems to 
confuse a bit the behaviour of matplotlib.
so I commented in both function show and only put it in the module that 
called both function.
Not to comfortable if you have to call a lot of function that use show 
command but it worked :)

Giorgio


-
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.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] How to clean memory after plots ?

2006-12-20 Thread Giorgio Luciano
I've done some prograss about visualising my plots from a function, but 
after searching in the FAQ and also in the amiling list archive i dint' 
find any solution to this.
I have a function that computes some data for a plot. I call the 
function and then use show.
Everything work fine.
Then I close all the figure (closing manually windows) and also using 
close() in the console (using IDLE) then I rerun the function because I 
need to make some changes.
But when I restart the function the precedent show() seems still active 
and make me all plots freeze.
Is there a way to clean the memory of matplotlib without restarting 
the shell. Because if I restart shell obviously I loose all the data the 
I need for redoing the calculation.
Any help very appreciated.
Giorgio



-
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.phpp=sourceforgeCID=DEVDEV
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] [Crash with matplotlib and 14415 points help please :) ]

2006-12-19 Thread Giorgio Luciano

Hello to all,
I'm finishing to convert a module for linear regression that I used in 
Matlab. It takes an experimental matrix, and a response matrix perform a 
regression and a bit of plot and then give me  3 matrices that I need to 
plot response surface and leverage surface. For plotting leverage and 
response I need to create a kind of grid of point with another program. 
and at this point everything work fine (checked also in comparison with 
matlab). The problems come when I tri to plot it. For a step of 2 (not 
really a grid) it works with 30 steps everything crashes :(

so nste=2 work nstep=30 not
I attach the file that give no problems it's a module with included the 
matrix to be plotted with nstep=2 and also the problematic one. a 
function with the same name of the plot and the matrices that give the 
problems.
Every help would be greatly appreciated because if I fix it I can get 
rid of the regression program in matlab that i generally use really a 
lot in my everyday job

Giorgio


test.tar.tar.bz2
Description: Binary data
# plots leverage plot (3d surface+ contour)
from numpy import *
import pylab as p
import matplotlib.axes3d as p3
#nstep 30 doesnt' work
#nstep 2 ok
def pyplotlev(disper,nstep,gr,lab):
  h=lab.size
  lev2=empty((1,h))
  ir=1
  for j in arange(1,nstep+2):
#a=gr[[arange(ir-1,ir+nstep)],:]
a2=gr[arange(ir-1,ir+nstep)]
#flev=dot(a2,dot(disper,a2.transpose()))
clev=diag(dot(a2,dot(disper,a2.transpose(
lev2=vstack((lev2,clev))
#print ir
#print clev
#print h
ir=ir+nstep+1
  lev=lev2[1:,]
  #print lev
  fig=p.figure(1)
  H,K = meshgrid(lab,lab)
  ax=p3.Axes3D(fig)
  ax.plot_wireframe(H,K,lev)
  p.close
  fig2=p.figure(2)
  ic=p.contour(lev)
  p.clabel(ic)
  p.axis('scaled')
  p.close
  p.show()
  return lev
  

# plots leverage plot (3d surface+ contour)
#def plotlev(disper,nstep,gr,lab)
#return lev
from numpy import *
import pylab as p
import matplotlib.axes3d as p3
disper=array([[  3.e-01,   0.e+00,   0.e+00,
  0.e+00,   0.e+00,   0.e+00,
  0.e+00,   0.e+00,   0.e+00,
  0.e+00,   0.e+00,  -8.e-02,
 -8.e-02,  -8.e-02,  -8.e-02],
   [  8.06369358e-18,   4.1667e-02,  -7.46669644e-18,
  5.44289817e-18,   7.44683153e-19,  -3.98129642e-33,
 -1.36031186e-33,  -2.81282874e-34,   2.25994703e-34,
  4.39080865e-34,   2.73462800e-34,  -2.51015994e-20,
  2.42816787e-18,  -5.73736077e-18,  -5.73736077e-18],
   [  7.59815453e-34,   2.75067079e-18,   4.1667e-02,
  3.25260652e-18,  -6.93889390e-18,   1.88126612e-17,
  3.00173761e-18,   5.35741887e-18,   3.92009338e-18,
 -1.59648722e-18,  -1.47163184e-18,  -2.52965300e-18,
  1.91454635e-18,  -3.63957438e-18,   4.25468104e-18],
   [  1.91623297e-33,   7.20982710e-18,  -4.11996826e-18,
  4.1667e-02,   1.56125113e-17,  -4.70316529e-18,
 -7.50434402e-19,  -1.33935472e-18,  -9.80023345e-19,
  3.99121804e-19,   3.67907960e-19,   1.72379303e-18,
  3.94332907e-18,  -4.59987963e-18,  -1.06724246e-18],
   [  4.89006605e-34,   3.39487908e-18,  -8.67361738e-18,
 -6.93889390e-18,   4.1667e-02,  -1.81124885e-17,
 -1.23264906e-17,   1.26063318e-17,   9.52609141e-18,
 -3.43268159e-18,  -5.42195377e-18,  -4.26328796e-18,
  1.35026269e-18,   1.10487576e-18,   1.80814951e-18],
   [  2.53689072e-33,   4.06372644e-33,  -2.69948714e-18,
  6.74871784e-19,  -2.01018321e-17,   6.2500e-02,
 -2.60208521e-17,   2.60208521e-18,  -4.33680869e-19,
  3.90312782e-18,   1.73472348e-18,  -2.23221945e-18,
  2.23221945e-18,   5.98507262e-18,  -5.98507262e-18],
   [  2.03221450e-34,   1.70837377e-33,  -3.99900428e-18,
  9.99751071e-19,  -9.46725781e-18,  -3.90312782e-18,
  6.2500e-02,   3.46944695e-18,  -3.46944695e-18,
 -1.56125113e-17,  -3.46944695e-18,  -8.64326920e-18,
  8.64326920e-18,   1.55031307e-18,  -1.55031307e-18],
   [  8.64890457e-34,  -1.47888028e-33,   2.72498991e-18,
 -6.81247477e-19,   8.16289482e-18,  -1.56125113e-17,
  1.38777878e-17,   6.2500e-02,   1.04083409e-17,
  1.04083409e-17,   8.67361738e-18,  -5.23347420e-18,
  5.23347420e-18,   7.27515326e-19,  -7.27515326e-19],
   [  1.78178639e-33,   4.84667488e-34,   6.99282073e-18,
 -1.74820518e-18,   1.48015167e-17,  -3.90312782e-18,
  5.20417043e-18,  -6.93889390e-18,   6.2500e-02,
 -1.90819582e-17,  -2.68882139e-17,  -3.08112113e-18,
  3.08112113e-18,  -3.02713500e-19,   3.02713500e-19],
   [ -1.16429297e-35,   4.79634801e-35,  -2.17349863e-18,
  5.43374657e-19,  -3.83189970e-18,   1.73472348e-18,
 -4.33680869e-18,   5.20417043e-18,  -1.21430643e-17,
  6.2500e-02,  

[Matplotlib-users] [problems with closing figure, memory problem ?]

2006-12-19 Thread Giorgio Luciano
Sorry for the previsou post. Tweaking a bit I found that probably the 
problem is not in the visualisation but in cleaning memory.

I use a function to make four plot calling two subfunction.
the plot are called plotrisp and plotlev in everyone of them any tome i 
use a figure I also close it. But if I only use one fuction it do the 
plot. WhenI try to use them to plot no way it stuck in the end.
So I had the same problem while calling multiple plots with multiple 
function

Any help would be appreciated and sorry for the dup post

nstep=30


Giorgio


from numpy import *
import pylab as p
import matplotlib.axes3d as p3
# plots leverage plot (3d surface+ contour)
def pyplotrisp (b,nstep,gr,lab):
  h=lab.size
  risp2=empty((h,1))
  ir=1
  for j in arange(1,nstep+2):
#a=gr[[arange(ir-1,ir+nstep)],:]
b2=gr[arange(ir-1,ir+nstep)]
#flev=dot(a2,dot(disper,a2.transpose()))
crisp=dot(b2,b)
risp2=hstack((risp2,crisp))
print ir
print crisp
print risp2
ir=ir+nstep+1
  [M,L]=risp2.shape
  risp=risp2[:,arange(1,L)]
  print risp
  p.figure
  ic=p.contour(risp)
  p.clabel(ic)
  p.axis('scaled')
  p.close
  H,K = meshgrid(lab,lab)
  fig2=p.figure()
  ax2=p3.Axes3D(fig2)
  ax2.plot_wireframe(H,K,risp)
  p.close
  p.show()
  return risp

  

9.785400e-001
-1.005400e-002
-4.158800e-003
-2.830800e-002
-1.009200e-002
-2.493500e-003
2.509200e-003
3.7500029400e-003
8.7500047700e-003
-7.478900e-003
-7.520500e-003
1.2500126000e-003
-1.2499765200e-003
-2.4999627500e-003
1.2500403600e-003
3.343100e-001 0.00e+000 0.00e+000 
0.00e+000 0.00e+000 0.00e+000 
0.00e+000 0.00e+000 0.00e+000 
0.00e+000 0.00e+000 -8.362000e-002 
-8.362000e-002 -8.362000e-002 -8.362000e-002
8.063693575130939100e-018 4.167100e-002 -7.466696441424020800e-018 
5.442898171701501700e-018 7.446831533558328100e-019 -3.981296423947523400e-033 
-1.360311859369367600e-033 -2.812828735141543300e-034 2.259947026447235500e-034 
4.390808650062400600e-034 2.734628002940427000e-034 -2.510159939866114900e-020 
2.428167867294735600e-018 -5.737360769959190400e-018 -5.737360769959193500e-018
7.598154529375859700e-034 2.750670794648198700e-018 4.165700e-002 
3.252606517456512100e-018 -6.938893903907227600e-018 1.881266115781307300e-017 
3.00173760674520e-018 5.357418870882074000e-018 3.920093381513243500e-018 
-1.596487216230838300e-018 -1.471631841958520700e-018 
-2.529653004892762600e-018 1.914546345013781500e-018 -3.639574377949061200e-018 
4.25468103782804e-018
1.916232971842715000e-033 7.209827103475922500e-018 -4.119968255444918400e-018 
4.164400e-002 1.561251128379126400e-017 -4.703165289453265200e-018 
-7.504344016863050200e-019 -1.339354717720509800e-018 
-9.800233453782993300e-019 3.991218040577071800e-019 3.679079604896299400e-019 
1.723793026891109400e-018 3.943329065986273500e-018 -4.599879633360827600e-018 
-1.067242459516556400e-018
4.890066054477537100e-034 3.394879081475125300e-018 -8.673617379884024700e-018 
-6.938893903907231500e-018 4.163700e-002 -1.811248849411297100e-017 
-1.232649058115857300e-017 1.260633175768506600e-017 9.526091405915190700e-018 
-3.432681590033676600e-018 -5.421953771683235600e-018 
-4.263287963462097500e-018 1.350262687099568600e-018 1.104875764931516900e-018 
1.808149511431011000e-018
2.536890719600698900e-033 4.063726437323978200e-033 -2.699487135751760500e-018 
6.748717839379484200e-019 -2.010183206209276600e-017 6.248600e-002 
-2.602085213965210600e-017 2.602085213965210600e-018 -4.336808689942017700e-019 
3.903127820947816000e-018 1.734723475976807100e-018 -2.232219446375430500e-018 
2.232219446375430500e-018 5.985072623326622900e-018 -5.985072623326622900e-018
2.032214496590675000e-034 1.708373769186458100e-033 -3.999004283483412900e-018 
9.997510708708580400e-019 -9.467257814775494300e-018 -3.903127820947816000e-018 
6.25e-002 3.469446951953614200e-018 -3.469446951953614200e-018 
-1.561251128379126400e-017 -3.469446951953614200e-018 
-8.643269201659448900e-018 8.643269201659450400e-018 1.550313073537109300e-018 
-1.550313073537111600e-018
8.648904567117544200e-034 -1.478880281038128200e-033 2.724989909059686100e-018 
-6.812474772649243300e-019 8.162894818485949200e-018 -1.561251128379126400e-017 
1.387778780781445700e-017 6.249300e-002 1.040834085586084300e-017 
1.040834085586084300e-017 8.673617379884035500e-018 -5.23347419861849e-018 
5.233474198618489200e-018 7.275153256153026200e-019 -7.275153256153018500e-019
1.781786392369606100e-033 4.846674875901112200e-034 6.992820730148195700e-018