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 visualizzazione (ultimi 30 giorni)
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);

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 27 Giu 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);

Più risposte (0)

Categorie

Scopri di più su Contour Plots in Help Center e File Exchange

Prodotti


Release

R14SP2

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by