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

Warning: possibly dumb question :-(

I have two functions I want to plot with the Filling option, like:

Plot[{Sin[t], Cos[t]}, {t, 0, 4 Pi}, Filling -> Axis]

That's OK. But if I only want the sine filled, and try

Plot[{Sin[t], Cos[t]}, {t, 0, 4 Pi}, Filling -> {Axis, None}]

MMA returns error messages that Axis and None are not valid Filling specifications. How can I selectively apply Filling?

share|improve this question
up vote 7 down vote accepted

Remember to look in the documentation when facing problems like this. Most options are well documented. For this case you could go to Filling and see that it states:

{i1->p1,i2->p2,...} fill from object ik to pk

So for your case you would write:

 Plot[{Sin[t], Cos[t]}, {t, 0, 4 Pi}, Filling -> {1 -> Axis}]
share|improve this answer
+1 for the first sentence. – J. M. Aug 16 '12 at 8:32
Thanks, jVincent. Easier than I anticipated. @J.M. - I had looked in the documentation, but stumbled over the fifth bullet item. Probably expected something more sophisticated. – stevenvh Aug 16 '12 at 8:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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