File: face_alpha_demo.m

package info (click to toggle)
octplot 0.4.0-7
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 3,072 kB
  • ctags: 1,563
  • sloc: cpp: 8,133; ansic: 5,053; sh: 617; makefile: 161
file content (21 lines) | stat: -rw-r--r-- 422 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
clf
# create sombrero
x = linspace(-8,8,72);
y = linspace(-8,8,74);
[xx,yy] = meshgrid(x,y);
r = sqrt(xx.^2 + yy.^2) + eps;
zz = sin (r) ./ r;

pcolor(xx,yy,zz);
colormap(jet);
h=get(gca,'Children');
shading interp;
ht=text(2,7,'FaceAlpha = 0.00');
set(ht,'FontSize',12);
for i=0:0.01:1.0
  set(h,'FaceAlpha',i);
  pause(0.02)
  msg=sprintf('FaceAlpha = %4.2f',i);
  set(ht,'String',msg);
end
disp('end of demonstration')