4
$\begingroup$

I have a curve. If I want to color fill or shade, not towards axis but upward form the curve, what command can I use?

$\endgroup$

1 Answer 1

5
$\begingroup$
Plot[Sin[x], {x, 0, 2 Pi}, Filling -> Top]

enter image description here

Plot[Sin[x], {x, 0, 2 Pi}, Filling -> 0.5]

enter image description here

Plot[Sin[x], {x, 0, 2 Pi},
 Filling -> 0.5,
 FillingStyle ->
  {Directive[Opacity[0.5], Orange],
   Directive[Opacity[0.5], Yellow]},
 GridLines -> {None, {0.5}},
 GridLinesStyle -> Dashed

enter image description here

$\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.