Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## matplotlib-users

 Re: [Matplotlib-users] matplotlib and py2exe From: Giorgio Luciano - 2007-04-03 12:21:05 ```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 o>c: 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()0.0000001: 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 tt0.0000001: 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 ```
 Re: [Matplotlib-users] matplotlib and py2exe From: Daniel Stalder - 2007-04-04 04:42:08 ```Hello I saw your thread and I have a related problem. I use matplotlib (0.90.0.win32-py2.5) with wxPython (2.8-win32-unicode-2.8.3.0-py25). I use matplotlib with WXAgg and got the following error msg: "This application has failed to start because wxmsw26uh_vc.dll was not found. Re-installing the application may fix this problem." The error msg appears on "import _wxagg" in the file backend_wxagg.py # try to load the WXAgg accelerator try: import _wxagg >>> the msg appears here except ImportError: _wxagg = None I already had this problem with previous versions of both libraries. Thanks for any help Daniel -----Original Message----- From: Werner F. Bruhin [mailto:werner.bruhin@...] Sent: Wednesday, 4 April 2007 2:58 a.m. To: luciano@...; matplot Subject: Re: [Matplotlib-users] matplotlib and py2exe Hi Giorgio, Giorgio Luciano wrote: > 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) I assume the DLL not found is "wxmsw26uh_vc.dll" at least I believe that 87.7 is already compiled against wxPython 2.6 Unicode (hopefully this dependency will go away with some future release of matplotlib), so you need to either use the Unicode version of wxPython 2.6 or do the following as mentioned earlier in this thread. matplotlib/backends/_wxagg.pyd to matplotlib/backends/_wxagg not used.pyd If it is another .dll missing it would help if you let us know the name and the exact exception. Werner ------------------------------------------------------------------------- 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@... https://lists.sourceforge.net/lists/listinfo/matplotlib-users This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. This electronic transmission and any documents accompanying this electronic transmission contain confidential information belonging to the sender. This information may be legally privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on or regarding the contents of this electronically transmitted information is strictly prohibited. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ```
 Re: [Matplotlib-users] matplotlib and py2exe From: Werner F. Bruhin - 2007-04-04 08:31:44 ```Hi Daniel, Daniel Stalder wrote: > Hello > > I saw your thread and I have a related problem. > I use matplotlib (0.90.0.win32-py2.5) with wxPython > (2.8-win32-unicode-2.8.3.0-py25). > I use matplotlib with WXAgg and got the following error msg: > "This application has failed to start because wxmsw26uh_vc.dll was not > found. Re-installing the application may fix this problem." > Re-install will not help. The problem is that matplotlib is compiled/linked against wxPython 2.6 Unicode. A work around Andrea Gavana found is to do the following rename, before you py2exe the app. matplotlib/backends/_wxagg.pyd to matplotlib/backends/_wxagg not used.pyd Werner ```
 Re: [Matplotlib-users] matplotlib and py2exe From: Werner F. Bruhin - 2007-04-04 10:25:04 Attachments: setup.py     simple_plot.py ```Hi Giorgio, Had a quick look at pylab based scripts and got an error on backend_tkagg when py2exe it. It looks like one needs to force the backend to be included, I used tkagg but you would have to replace that with wxagg for your script. Attached is a setup.py and from the examples the file simple_plot.py. Werner ```