Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

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

1 Answer 1

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 at 5:41

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