help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

transparent colors?


From: Uwe Brauer
Subject: transparent colors?
Date: Tue, 26 Jul 2011 16:44:53 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) XEmacs/21.5-b29 (linux)

Hello 

I finally solved the problem of my plot. 
The situation is as follows, there are 4 different
surfaces. I can either plot the surfaces in 4 different
subplots or together. However when I do the latter then two
of the surfaces are hidden inside on (the are distorted
balls).
In matlab they can be seen since one can specify transperent
colors. Is there anything similar in octave?


Code in question.
,----
| graphics_toolkit fltk 
| [x,y,z]=meshgrid(-20:0.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;
| end
| 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','black')
| %    title(strcat('orbital-', num2str(n-i)))
|      daspect([1,1,1])
|      view(3); 
|      axis tight
| end
|  
`----

Here is the matlab plot, the octave plot is similar but the
two interior balls cannot be seen.

Uwe Brauer 


Attachment: graph-all-matlab.jpg
Description: JPEG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]