|
From: | Liam Groener |
Subject: | Re: matlab code: isovalues and isosurface |
Date: | Sat, 16 Jul 2011 03:46:13 -0700 |
On Jul 16, 2011, at 2:43 AM, Martin Helm wrote:
Yes, you are right. I was fooled by the facts that all the plotting commands are inside the loop and that most of the cpu time was being used by the octave process rather than by gnuplot. I guess that during the loop, the gnuplot commands are placed in a que and octave continues feeding them to gnuplot over the length of the run? I have been running with both the gnuplot and fltk backends. I swear I was getting similar plots from both earlier in the day (actually yesterday now). However, recently, I have not been able to make fltk work. It just plots the axes and finishes with no actual plot or error message. The m-file I'm currently using reads: [x,y,z]=meshgrid(-20:.5:20); function Psi=FdOn320(x,y,z) r=sqrt(x.^2+y.^2+z.^2); Psi=exp(-r./3).*(3*z.^2-r.^2).*2*sqrt(15/(120*pi))/81; endfunction Psi=FdOn320(x,y,z); m=min(Psi(:)); M=max(Psi(:)); color=[1 1 0;1 0 1; 0 1 1;0 1 0;1 0 0; 0 0 1; 0 0 0]; n=5; for i=1:n-1 isovalue=m+i*(M-m)/n; fv = isosurface(x,y,z,Psi,isovalue); hpatch = patch(fv); isonormals(x,y,z,Psi,hpatch); Alphalevel=0.2+0.8*i/n; set(hpatch,'FaceAlpha',Alphalevel,'FaceColor',color(i,:),'EdgeColor','none') set(hpatch,'FaceColor',color(i,:),'EdgeColor','none') daspect([1,1,1]) view(3); axis tight % camlight left; end s = 'hi' Earlier, I was trying small variations in this. Note that I uncommented out the daspect command since octave 3.4.2 supports it. I just added the last line, my crude way of verifying that the loop finishes fast as you said. |
[Prev in Thread] | Current Thread | [Next in Thread] |