# Specify a color in a contour plot according to density?

GROUPS:
 The following code allows one to manipulate the parameters and see the corresponding contours for a bivariate normal. What I would like to do is make the background white after the density is below a value say .02. Using the following code creates a dark blue background. I was wondering if is blue because the density is less a particular value but am not sure. Is this possible to specify a density value, below which you can specify a color? I played around with ContourShading but with no success. Here is my code: Manipulate[ ContourPlot[ PDF[BinormalDistribution[{Subscript[\[Mu], 1], Subscript[\[Mu], 2]}, {Subscript[\[Sigma], 1], Subscript[\[Sigma], 2]}, \[Rho]], {x, y}], {x, -3, 3}, {y, -3, 3}, ContourLabels -> True, PlotRange -> All, PlotPoints -> 40], {Subscript[\[Mu], 1], -2, 2}, {Subscript[\[Mu], 2], -2, 2}, {Subscript[\[Sigma], 1], 1, 3}, {Subscript[\[Sigma], 2], 1, 3}, {\[Rho], -0.9, 0.9}] 
1 year ago
4 Replies
 You may play around with PlotLegends and ColorFunction. For example Manipulate[ ContourPlot[ PDF[BinormalDistribution[{Subscript[\[Mu], 1], Subscript[\[Mu], 2]}, {Subscript[\[Sigma], 1], Subscript[\[Sigma], 2]}, \[Rho]], {x, y}], {x, -3, 3}, {y, -3, 3}, ContourLabels -> True, PlotRange -> All, PlotPoints -> 40, PlotLegends -> Automatic, ColorFunction -> (ColorData["GreenBrownTerrain"][ 1 - #] &)], {Subscript[\[Mu], 1], -2, 2}, {Subscript[\[Mu], 2], -2, 2}, {Subscript[\[Sigma], 1], 1, 3}, {Subscript[\[Sigma], 2], 1, 3}, {\[Rho], -0.9, 0.9}] 
 It's one of the thousands of features of Mathematica. Look up ColorData, ColorSchemes in the documentation. There is also a ColorSchemes palette.