matlab 'colorbar' error

16 views (last 30 days)
Bill Johns
Bill Johns on 17 Jan 2022
Commented: Walter Roberson on 19 Jan 2022
I am getting this error message thread when I try to add a colorbar to a figure, thanks for any help!:
>> colorbar
Check for incorrect argument data type or missing argument in call to function
'imag'.
Error in flipud (line 14)
x = flip(x,1);
Error in matlab.graphics.shape.internal.AxesLayoutManager/insertAboveAxes
Error in matlab.graphics.shape.internal.AxesLayoutManager.getManager
Error in legendcolorbarlayout (line 34)
hManager = matlab.graphics.shape.internal.AxesLayoutManager.getManager(hAx);
Error in matlab.graphics.illustration.ColorBar/setAxesImpl
Error in matlab.graphics.illustration.ColorBar/set.Axes_I
Error in matlab.graphics.illustration.ColorBar/set.Axes
Error in colorbar (line 238)
cbar.Axes = peeraxes;
  8 Comments
Adam Danz
Adam Danz on 19 Jan 2022
I wonder why your paths do not indicate "Shadowed" as shown below.
which flip -all
/MATLAB/toolbox/matlab/elmat/flip.m flip is a built-in method % Shadowed connector.internal.LoggerLevel method flip is a built-in method % Shadowed matlab.internal.lang.capability.Capability method flip is a built-in method % Shadowed matlab.lang.OnOffSwitchState method flip is a built-in method % Shadowed matlab.internal.reference.property.RefEntityType method flip is a built-in method % Shadowed matlab.internal.reference.api.EntityPrecision method flip is a built-in method % Shadowed matlab.internal.reference.property.DeprecationStatus method flip is a built-in method % Shadowed matlab.internal.reference.property.FunctionType method flip is a built-in method % Shadowed matlab.internal.reference.api.EntityCaseSensitivity method flip is a built-in method % Shadowed mf.zero.meta.Language method flip is a built-in method % Shadowed dig.config.CommandType method flip is a built-in method % Shadowed dig.config.HorizontalAlignment method flip is a built-in method % Shadowed dig.model.DisplayState method flip is a built-in method % Shadowed dig.model.EventDataType method flip is a built-in method % Shadowed dig.model.FunctionType method flip is a built-in method % Shadowed dig.model.ValidInBdType method flip is a built-in method % Shadowed dig.model.ViewMode method flip is a built-in method % Shadowed simulink.FindSystemTask.Status method flip is a built-in method % Shadowed sl.data.adapter.AdapterDiagnostic method flip is a built-in method % Shadowed sl.data.adapter.AdapterType method flip is a built-in method % Shadowed sl.data.adapter.ChangeType method flip is a built-in method % Shadowed slid.SourceIssue method flip is a built-in method % Shadowed slid.broker.SourceManagerSourceKind method flip is a built-in method % Shadowed targetframework.internal.repository.DataSource method flip is a built-in method % Shadowed coderdictionary.data.AccessFunctionSignaturesEnum method flip is a built-in method % Shadowed coderdictionary.data.AccessInterfaceEnum method flip is a built-in method % Shadowed coderdictionary.data.AccessModeEnum method flip is a built-in method % Shadowed coderdictionary.data.AllowedAccessEnum method flip is a built-in method % Shadowed coderdictionary.data.DataAccessEnum method flip is a built-in method % Shadowed coderdictionary.data.DataAccessTypeEnum method flip is a built-in method % Shadowed coderdictionary.data.DataInitEnum method flip is a built-in method % Shadowed coderdictionary.data.DataInstantiationEnum method flip is a built-in method % Shadowed coderdictionary.data.LatchingModeEnum method flip is a built-in method % Shadowed coderdictionary.data.PlacementEnum method flip is a built-in method % Shadowed coderdictionary.data.RTEWhenToCallRule method flip is a built-in method % Shadowed coderdictionary.data.ScopeEnum method flip is a built-in method % Shadowed coderdictionary.data.StatementsSurroundEnum method flip is a built-in method % Shadowed coderdictionary.data.StatusEnum method flip is a built-in method % Shadowed dastudio_util.cooperative.AsyncFunctionRepeaterTask.Status method flip is a built-in method % Shadowed matlab.unittest.Verbosity method flip is a built-in method % Shadowed matlab.unittest.internal.fixtures.FolderScope method flip is a built-in method % Shadowed matlab.internal.timer.CallBackTypeEnum method flip is a built-in method % Shadowed matlab.internal.timer.BusyModeEnum method flip is a built-in method % Shadowed matlab.internal.timer.ExecutionModeEnum method flip is a built-in method % Shadowed matlab.pyclient.Status method /MATLAB/toolbox/matlab/bigdata/@tall/flip.m % Shadowed tall method /MATLAB/toolbox/parallel/gpu/@gpuArray/flip.m % Shadowed gpuArray method /MATLAB/toolbox/parallel/parallel/@distributed/flip.m % Shadowed distributed method built-in % Shadowed char method built-in % Shadowed double method built-in % Shadowed int16 method built-in % Shadowed int32 method built-in % Shadowed int64 method built-in % Shadowed int8 method built-in % Shadowed logical method built-in % Shadowed single method built-in % Shadowed uint16 method built-in % Shadowed uint32 method built-in % Shadowed uint64 method built-in % Shadowed uint8 method

Sign in to comment.

Answers (1)

VBBV
VBBV on 19 Jan 2022
Edited: VBBV on 19 Jan 2022
This syntax does not seem to be supported in Matlab
axis('ij')
See what you get if you change it to
axis ij
  2 Comments
Walter Roberson
Walter Roberson on 19 Jan 2022
I do not observe any problem with axis('ij') ?
pcolor(1:10,11:20,rand(10,10))
axis('ij')
colorbar

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!