From: Makarand on
"Bui Yuki" <buihongha(a)gmail.com> wrote in message <hovloh$58k$1(a)fred.mathworks.com>...
> "us " <us(a)neurol.unizh.ch> wrote in message <hovl7l$o7q$1(a)fred.mathworks.com>...
> > "Bui Yuki" <buihongha(a)gmail.com> wrote in message <hovkkt$ftk$1(a)fred.mathworks.com>...
> > > > works as expected here (r2010a)...
> > > > which ML ver do you have(?)...
> > > >
> > > > us
> > >
> > > Hi us,
> > >
> > > Thanks for your reply. I am using Matlab 7.01. As I explained in my reply to Oliver, the figure looks fine; however, the colorbar is not. If the above code works well in Matlab(r2010a), my problem may be because of Matlab version.
> > >
> > > Bui
> >
> > hmm... this may be a ...visual... problem...
> >
> > % try this and tell CSSM what you see...
> > x=1:1:100;
> > y=1:1:100;
> > data=1:1:100;
> > scatter(x,y,500,data,'.');
> > caxis([0.0 100]);
> > colormap(jet(5)); % <- change color reps...
> > colorbar;
> >
> > us
>
> Hi us,
>
> Thanks for quick reply.
> I tried your code in my Matlab and got the same result as mine.
>
> Perhaps, I need to update my Matlab version?
You need not change the mat lab version for just the colorbar
try this
L1=((1:length(Levls))*(diff(caxis)/(length(Levls)+1)))+min(caxis());
Where the Levls used to calssify the data
and then
h_bar=colorbar('YTick',L1,'YTickLabel',Levls,'YGrid','on');
tell me if it worked correctly
 | 
Pages: 1
Prev: how to select cells in uitable
Next: Interpolation