I have something plotted on [-6,6] but I would like to fill only the part from [-5,5] (to the axis). I'm looking through the documentation but I'm not terribly well-versed in Mathematica and can't seem to find what I'm looking for. Help is appreciated!

  • 2
    $\begingroup$ Do you have a function to use to show how to do it? You can start by looking at Filling $\endgroup$
    – Nasser
    Jan 10, 2014 at 4:46
  • $\begingroup$ Related: (9684), (14696), (18964), (25169), (25640) $\endgroup$
    – Mr.Wizard
    Jan 10, 2014 at 10:22

1 Answer 1

f[{r1_, r2_}, opts___] := Plot[Sin[x], {x, r1, r2}, opts]
Show[f[{-6, 6}], f[{-5, 5}, Filling -> Axis]]

Mathematica graphics

  • $\begingroup$ Great, thank you so much! I was resorting to doing a second, completely separate plot of the function on a smaller domain and Showing both of those, seemed so inelegant. $\endgroup$
    – user11651
    Jan 10, 2014 at 5:41

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