common colorbar
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Dear all,
I made a function f_colorbar.m enabling me to customize a colorbar. However, all of a sudden (& months ago it work without the error and in between I did not change anything at least to my knowledge that could cause this) I get this warning-error:
>> Error in ==> legendcolorbarlayout>layoutColorbar at 829 [width,height]=preferredColorbarSize(origc);
??? Output argument "newpos" (and maybe others) not assigned during call to "C:\Program Files\MATLAB\R2010b\toolbox\matlab\scribe\legendcolorbarlayout.m>layoutColorbar".
Error in ==> legendcolorbarlayout>doInOutLayout at 498 [newpos,corners] = layoutColorbar(location,corners,origc);
Error in ==> legendcolorbarlayout>doLayout at 441 doInOutLayout(par,fig,outlist,corner1,corner2,false);
Error in ==> legendcolorbarlayout>doParentResize at 338 doLayout(ch);
Warning: Error occurred while evaluating listener callback. > In legendcolorbarlayout>reclaimSpace at 1002 In legendcolorbarlayout at 88 In scribe.colorbar.init>changedLocation at 92 In scribe.colorbar.init>changedPos at 116 In f_colorbar at 125 >>
The 125 line says set(hcb,'position',newpos). By the way, on my other computer, having the same matlab (2010b) and the same OS (Win 7 x64) I do not encounter this issue.
Any ideas, ... anything ?
Cheers
Blaz
0 Kommentare
Akzeptierte Antwort
Matt Tearle
am 20 Apr. 2011
Hard to say without seeing the code, but it looks like there's some condition that makes it possible for layoutColorbar to complete without newpos ever being defined -- that's the initial warning, which then leads to the error on line 125 of f_colorbar. Presumably it's a subtle bug in the logic which hasn't manifested until now.
With the Editor, you can highlight a variable and see where it shows up in that file. Maybe you can use that to trace the creation of newpos and see if there's anything that could prevent it. You could also simply try putting a breakpoint in layoutColorbar and stepping through (when running an example you know is failing).
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!