For Programmers: Free Programming Magazines  


Home > Archive > Matlab > November 2005 > how to use transparent color?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how to use transparent color?
Breeze

2005-11-29, 7:07 pm

I am using 'fill' function to plot my result. Can I use transparent
color to plot my result?

Thanks!
helper

2005-11-29, 7:07 pm

Breeze wrote:
>
>
> I am using 'fill' function to plot my result. Can I use transparent
> color to plot my result?
>
> Thanks!


Use the FaceAlpha property:

close all
t = (1/16:1/8:1)'*2*pi;
x = sin(t);
y = cos(t);
fill(x,y,'r','facealpha',.5)
axis square

% Now plot a sphere beneath to show the transparency.
hold on
[x y z]=sphere;
surf(x/2,y/2,z/2-1)
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com