I want to include color bar for my plot. I have done the plot using the following code:

, PlotRange -> All
, ColorFunction -> Function[{Sw, ϕ, Eρg}, Hue[Eρg]]
, AxesLabel -> {"Sw", "ϕ", "Eρg"}

But I need to include color bar. Kindly tell me what to do.

  • 1
    $\begingroup$ But welcome to Stack Exchange... I know it can seem a bit challengingly complex at first with all the different sites and rules on what goes where and such. But hope you'll stick with it and continue to get involved with the site, it's worth it! $\endgroup$
    – JeopardyTempest
    Commented Aug 6, 2018 at 18:47

1 Answer 1


I guess you needs this:

ListPlot3D[...bla-bla-bla...,PlotLegends->BarLegend[{Hue, {0, 0.7}}, 10]]

it will give your plot with following at the right:

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.