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.

I can't get this to work, the Show function shows only the first plot. Why this happens and how to solve it?

Show[Plot[x^2, {x, 2, 10}], Plot[1 - x, {x, 1, -10}]]
share|improve this question
    

1 Answer 1

up vote 11 down vote accepted

The reason this happens is that the Show command uses the PlotRange options of the first plot, which in this case is disjoint with the range of the second plot, So you have to tell it to show all relevant regions by doing

Show[Plot[x^2, {x, 2, 10}], Plot[1 - x, {x, 1, -10}], 
 PlotRange -> All]

show

share|improve this answer
1  
Congrats on 10k! :) –  rm -rf Jun 26 '12 at 22:09
3  
@R.M Thanks - saving the world, 10 rep points at a time... –  Jens Jun 26 '12 at 22:17
    
+1 Enlightened badge –  Mr.Wizard Jun 27 '12 at 7:08

Your Answer

 
discard

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.