MATLAB Answers

How to get more color gradient on a surface plot?

15 views (last 30 days)
Al
Al on 9 May 2015
Commented: Al on 20 May 2015
I have made a surface plot. The color gradient is mostly dark blue. How can I adjust the color gradient to get more colors?
Adjusting the color map in the plot tools does not work.

  0 Comments

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 9 May 2015
You need to manually build a non linear colormap. Attach your data and script so people can show you how.

  11 Comments

Show 8 older comments
Al
Al on 11 May 2015
It gave some errors and no plot output
Warning: Negative data ignored
> In rotate3d>localRotateOrbitMotionFcn at 981
In rotate3d>rotaMotionFcn at 909
In hgfeval at 62
In uitools.uimode.schema>localEvaluateMotionCallback at 265
In uitools.uimode.schema>@(obj,evd)(localEvaluateMotionCallback(obj,evd,valueProposed)) at 247
Warning: Negative data ignored
> In rotate3d>localRotateOrbitMotionFcn at 981
In rotate3d>rotaMotionFcn at 909
In hgfeval at 62
In uitools.uimode.schema>localEvaluateMotionCallback at 265
In uitools.uimode.schema>@(obj,evd)(localEvaluateMotionCallback(obj,evd,valueProposed)) at 247
Warning: Negative data ignored
> In rotate3d>localRotateOrbitMotionFcn at 981
In rotate3d>rotaMotionFcn at 909
In hgfeval at 62
In uitools.uimode.schema>localEvaluateMotionCallback at 265
In uitools.uimode.schema>@(obj,evd)(localEvaluateMotionCallback(obj,evd,valueProposed)) at 247
Warning: Negative data ignored
> In rotate3d>localRotateOrbitMotionFcn at 981
In rotate3d>rotaMotionFcn at 909
In hgfeval at 62
In uitools.uimode.schema>localEvaluateMotionCallback at 265
In uitools.uimode.schema>@(obj,evd)(localEvaluateMotionCallback(obj,evd,valueProposed)) at 247
Warning: Negative data ignored
> In rotate3d>localRotateOrbitMotionFcn at 981
In rotate3d>rotaMotionFcn at 909
In hgfeval at 62
In uitools.uimode.schema>localEvaluateMotionCallback at 265
In uitools.uimode.schema>@(obj,evd)(localEvaluateMotionCallback(obj,evd,valueProposed)) at 247
Warning: Negative data ignored
> In rotate3d>localRotateOrbitMotionFcn at 981
In rotate3d>rotaMotionFcn at 909
In hgfeval at 62
In uitools.uimode.schema>localEvaluateMotionCallback at 265
In uitools.uimode.schema>@(obj,evd)(localEvaluateMotionCallback(obj,evd,valueProposed)) at 247
Warning: Negative data ignored
> In rotate3d>localRotateOrbitMotionFcn at 981
In rotate3d>rotaMotionFcn at 909
In hgfeval at 62
In uitools.uimode.schema>localEvaluateMotionCallback at 265
In uitools.uimode.schema>@(obj,evd)(localEvaluateMotionCallback(obj,evd,valueProposed)) at 247
Warning: Negative data ignored
> In rotate3d>localRotateOrbitMotionFcn at 981
In rotate3d>rotaMotionFcn at 909
In hgfeval at 62
In uitools.uimode.schema>localEvaluateMotionCallback at 265
In uitools.uimode.schema>@(obj,evd)(localEvaluateMotionCallback(obj,evd,valueProposed)) at 247
Warning: Negative data ignored
> In rotate3d>localRotateOrbitMotionFcn at 981
In rotate3d>rotaMotionFcn at 909
In hgfeval at 62
In uitools.uimode.schema>localEvaluateMotionCallback at 265
In uitools.uimode.schema>@(obj,evd)(localEvaluateMotionCallback(obj,evd,valueProposed)) at 247
Warning: Negative data ignored
> In rotate3d>localRotateOrbitMotionFcn at 981
In rotate3d>rotaMotionFcn at 909
In hgfeval at 62
In uitools.uimode.schema>localEvaluateMotionCallback at 265
In uitools.uimode.schema>@(obj,evd)(localEvaluateMotionCallback(obj,evd,valueProposed)) at 247
Warning: Negative data ignored
> In rotate3d>localRotateOrbitMotionFcn at 981
In rotate3d>rotaMotionFcn at 909
In hgfeval at 62
In uitools.uimode.schema>localEvaluateMotionCallback at 265
In uitools.uimode.schema>@(obj,evd)(localEvaluateMotionCallback(obj,evd,valueProposed)) at 247
Warning: Negative data ignored
> In rotate3d>localRotateOrbitMotionFcn at 981
In rotate3d>rotaMotionFcn at 909
In hgfeval at 62
In uitools.uimode.schema>localEvaluateMotionCallback at 265
In uitools.uimode.schema>@(obj,evd)(localEvaluateMotionCallback(obj,evd,valueProposed)) at 247
Warning: Negative data ignored
> In rotate3d>localRotateOrbitMotionFcn at 981
In rotate3d>rotaMotionFcn at 909
In hgfeval at 62
In uitools.uimode.schema>localEvaluateMotionCallback at 265
In uitools.uimode.schema>@(obj,evd)(localEvaluateMotionCallback(obj,evd,valueProposed)) at 247
Warning: Negative data ignored
> In rotate3d>localRotateOrbitMotionFcn at 981
In rotate3d>rotaMotionFcn at 909
In hgfeval at 62
In uitools.uimode.schema>localEvaluateMotionCallback at 265
In uitools.uimode.schema>@(obj,evd)(localEvaluateMotionCallback(obj,evd,valueProposed)) at 247
Warning: Negative data ignored
> In plotchild at 26
In toolsmenufcn>LUpdateToolsMenu at 280
In toolsmenufcn at 110
In editmenufcn>localPost at 214
In editmenufcn at 38
Warning: Negative data ignored
> In plotchild at 26
In toolsmenufcn>LUpdateToolsMenu at 280
In toolsmenufcn at 110
In editmenufcn>localPost at 214
In editmenufcn at 38
Warning: Negative data ignored
> In plotchild at 26
In toolsmenufcn>LUpdateToolsMenu at 280
In toolsmenufcn at 110
In editmenufcn>localPost at 214
In editmenufcn at 38
Warning: Negative data ignored
> In getfigurefordesktopclient>fig2client at 21
In getfigurefordesktopclient at 12
Warning: Negative data ignored
> In graphics\private\prepare at 43
In print>LocalPrint at 264
In print at 233
In C:\Program Files\MATLAB\R2014a\toolbox\matlab\graphics\hgexport.p>hgexport at 895
In filemenufcn>localSaveExportHelper at 214
In filemenufcn>localSaveExport at 333
In filemenufcn at 56
Warning: Negative data ignored
Walter Roberson
Walter Roberson on 11 May 2015
I don't think you did what I asked. I think you did
surf(Xm, Ym, log10(Zm)); set(gca,'ZScale','log');
or else
surf(Xm, Ym, log10(Zm), Zm); set(gca,'ZScale','log');
or else
surf(Xm, Ym, log10(Zm), log10(Zm)); set(gca,'ZScale','log');
but what I asked for was
surf(Xm, Ym, Zm, log10(Zm)); set(gca,'ZScale','log');
You would only get the error you did if you had negative Zm or negative log10(Zm) in the third position in conjunction with log axis.
Al
Al on 20 May 2015
The one you asked for works. Thank you.
surf(Xm, Ym, Zm, log10(Zm)); set(gca,'ZScale','log');

Sign in to comment.

More Answers (0)

Sign in to answer this question.