From: Makarand on
"Martin Schmid" <tinez(a)remove.gmx.ch> wrote in message <h5r5tv$ase$1(a)fred.mathworks.com>...
> I am not able to produce a correct colorbar for a contour plot with specified axis limits. The problem seems to be specific for my installation of Matlab (7.0.4.365 (R14) SP2 on Windows XP 2002). Here is a simple example for the problem:
>
> I create a contour plot, say with the following commands:
> a = [1 2 3
> 3 2 4
> 1 4 5]
> contourf (a)
>
> If I now simply add a colorbar to this plot, it obviously ranges from 1 to 5.
> However, I want the colorbar to range from 0 to 10. I can do this with the command
>
> caxis ([1 10])
>
> The color mapping then changes accordingly.
>
> However, if I now plot the colorbar with the command
>
> colorbar
>
> I still get a colorbar that ranges from 1 to 5, while the colors in the figure remain scaled from 0 to 10, i.e. the colorbar does not agree with the colors in the figure.
>
> I have this problem on my desktop where I use Matlab 7.0.4.365 (R14) SP2 on Windows XP 2002, and it is the same on two other computers with the same installation.
> If I use exactly the same commands on my old laptop where I still have Matlab 5.3.0.10183 installed, everything works fine as it should.
>
> Did anyone ever see this strange behaviour and knows a solution?
Yes I am facing the similar problem, do you have the solution?