Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

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!

share|improve this question

marked as duplicate by Mr.Wizard Jan 10 '14 at 10:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Do you have a function to use to show how to do it? You can start by looking at Filling – Nasser Jan 10 '14 at 4:46
Related: (9684), (14696), (18964), (25169), (25640) – Mr.Wizard Jan 10 '14 at 10:22
up vote 2 down vote accepted
f[{r1_, r2_}, opts___] := Plot[Sin[x], {x, r1, r2}, opts]
Show[f[{-6, 6}], f[{-5, 5}, Filling -> Axis]]

Mathematica graphics

share|improve this answer
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. – user11651 Jan 10 '14 at 5:41

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