"us " <us@neurol.unizh.ch> wrote in message <gmbjmr$nv3$1@fred.mathworks.com>...
> "C F"
> > I have two vectors x and y. Each element of x is a probability, say .3, and the correspoding element in y is the complement of that probability, say .7. I need to create a graphic for each observation which is a square that is blue and red, where the blue area is proportional to the x probability and the y area is proportional to the Y probability. So for instance, I have a square, which is divided into 2 rectangles where the upper 30% is blue, and the lower 70% is red. Any ideas how to automate this for all observations? THanks, I know it's a bit obscure...
>
> ...indeed...
>
> one of the many solutions
>  why not just use the BAR function
>
> % the data
> x=rand(1,10);
> % the plot
> bar(x,1,'facecolor',[1,0,0]);
> axis tight;
> set(gca,...
> 'xtick',[],...
> 'ytick',[],...
> 'ylim',[0,1],...
> 'color',[0,1,0]);
>
> us
Hi, thanks for the response. I'm not sure this gets at what I ultimately want, since this will put all 18 observations next to each other on a set of axes. What I need for each observation is a solid square, 2 inches by 2 inches, where the square is split into rectangles by and the area of each color i proportional to the probability in my x and y vectors. If it cant automate its fine, i can do it 1 by 1 and save 18 different images. Thanks again for looking...
