Why do I receive an error when I create a figure containing a contour plot and a colorbar in MATLAB 7.0.4 (R14SP2)?
1 view (last 30 days)
Show older comments
I create a figure with a contour plot and a colorbar using the following code:
load flujet
h=image(X);
hold on;
[c,hc]=contour(get(h,'cdata'),[1 1],'w','linewidth',2);
colorbar
When I do this, I get the following error message:
??? Error using ==> set
Bad value for axes property: 'YLim'
Values must be increasing and non-NaN.
Error in ==> colorbar>make_colorbar at 170
ch=scribe.colorbar(peeraxes,location,position,pvpairs{:});
Error in ==> colorbar at 137
[c,msg] = make_colorbar(peeraxes,location,position,pvpairs);
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
There is a bug in MATLAB 7.0.4 (R14SP2) that causes the COLORBAR function to incorrectly determine the upper and lower limits of the colorbar.
To work around this issue, you can do the following:
load flujet
h=image(X);
hold on;
colorbar
[c,hc]=contour(get(h,'cdata'),[1 1],'w','linewidth',2);
0 Comments
More Answers (0)
See Also
Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!