From: Caroline on
"anthony woo" <ant_carl86(a)hotmail.com> wrote in message <gubddd$nk0$1(a)fred.mathworks.com>...
> Hi there,
>
> I would like to know if there is any way to change colors of histogram bars based on positions of the array, X in hist3 function? I know there is a way to change the color based on height of bars, but my case is changing colors based on positions as my intention is to have different colors for different elements in the array X which gives the bivariate histogram.
> Thanks. =)

Hi Anthony,

I have a similar problem. I'd like to change the colour of the histogram bars to represent how the data has been classified into groups. Did you find a solution? I'm currently exploring plotting my data as a surface instead then specifying patches to which colours can be allocated. I'll let you know if I have any luck.

Caroline
From: us on
"Caroline " <carolinertw(a)hotmail.com> wrote in message <hk7bvt$b40$1(a)fred.mathworks.com>...
> "anthony woo" <ant_carl86(a)hotmail.com> wrote in message <gubddd$nk0$1(a)fred.mathworks.com>...
> > Hi there,
> >
> > I would like to know if there is any way to change colors of histogram bars based on positions of the array, X in hist3 function? I know there is a way to change the color based on height of bars, but my case is changing colors based on positions as my intention is to have different colors for different elements in the array X which gives the bivariate histogram.
> > Thanks. =)
>
> Hi Anthony,
>
> I have a similar problem. I'd like to change the colour of the histogram bars to represent how the data has been classified into groups. Did you find a solution? I'm currently exploring plotting my data as a surface instead then specifying patches to which colours can be allocated. I'll let you know if I have any luck.
>
> Caroline

one of the solutions

m=ceil(5*rand(100,2));
mh=hist3(m);
bar3(mh);
xlabel('-X-');
colormap(jet(max(mh(:))));
colorbar;

us