2
$\begingroup$

I'd like to reproduce in Mathematica the output of this Wolfram Alpha query. Of course I can just use WolframAlpha but I'd like to manipulate the graphics (add another function, add legends, etc.) so I'm looking for a 'native' function.

I know about RegionPlot but I don't understand how to use it for this kind of inequality (if I just put it as first argument, it outputs a rectangular plot, which makes sense). Moreover I'd like to keep the graphs of the functions in the plot.

$\endgroup$
  • $\begingroup$ Use the Filling option of Plot. $\endgroup$ – Szabolcs Oct 28 '19 at 9:16
3
$\begingroup$

Use Filling.

Plot[{Sin[x], 1/x}, {x, 0, 4}, 
 Filling -> {1 -> {{2}, {None, Automatic}}}]

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.