1
$\begingroup$

Given a contour plot such as

function = Cos[c] + Cos[a]
pltc = ContourPlot[function == 1/2, {a, 0, 4 Pi}, {c, 0, 4 Pi}];

How can I color the regions in which function > 1/2 one color and function < 1/2 another color?

$\endgroup$
3
$\begingroup$
ContourPlot[Cos[c] + Cos[a], {a, 0, 4 Pi}, {c, 0, 4 Pi}, 
 Contours -> {1/2}, ContourShading -> {Red, Green}]

Mathematica graphics

$\endgroup$
3
$\begingroup$

you can also use RegionPlot

RegionPlot[{function <= 1/2, function > 1/2}, {a, 0, 4 Pi}, {c, 0, 
  4 Pi}, PlotStyle -> {Red, Green}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.