Tag Info

Hot answers tagged

8

You have to add the index for the colors to LineLegend Legended[Grid[{{Show[oniplot], Show[cpplot]}}], LineLegend[97, {"factor = 2", "factor = 3", "factor = 4", "factor = 5"}]] In order to have the legend above the plots and with markers: Legended[GraphicsGrid[{{Show[oniplot], Show[cpplot]}}], Placed[LineLegend[97, {"factor = 2", "factor = 3", ...


6

f@x_ := ColorData["VisibleSpectrum"][Rescale[x, {0, 1}, {380, 750}]]; Plot3D[ Exp[-x^2 - y^2], {x, -2, 2}, {y, -2, 2}, ColorFunction -> f, PlotLegends -> BarLegend[{f@# &, {0, 1}}]]


2

Your second solution can be improved by Evaluate[] on the first plot argument. Plot[Evaluate[y /. sol], {x, -10, 10}, PlotLegends -> Automatic]



Only top voted, non community-wiki answers of a minimum length are eligible