3
$\begingroup$

How do I fill left part of x=300 straight line with red colour and right part with green colour?

ContourPlot[x == 300, {x, 90 Pi, 150 Pi}, {y, 0, 4 Pi}]
$\endgroup$
2
  • 2
    $\begingroup$ ContourPlot[x, {x, 90 Pi, 150 Pi}, {y, 0, 4 Pi}, Contours -> {300}, ContourShading -> {Red, Green}] $\endgroup$
    – Bob Hanlon
    Commented Mar 27, 2021 at 22:29
  • $\begingroup$ It worked, Thanks. $\endgroup$ Commented Mar 29, 2021 at 13:24

1 Answer 1

1
$\begingroup$

Try

Show[
  ContourPlot[x==300,{x,90 Pi,150 Pi},{y,0,4 Pi}],
  Plot[4 Pi,{x,90 Pi,300},PlotRange->{0,4 Pi},Filling->Axis,FillingStyle->Red],
  Plot[4 Pi,{x,300,150 Pi},PlotRange->{0,4 Pi},Filling->Axis,FillingStyle->Green]
]

Mathematica graphics

$\endgroup$

Your Answer

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

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