Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I have a plot that I would like to slightly manipulate in Mathematica. Here is the code I am entering:

Plot[{x, 2^x, log_2(x)}, {x, -1, 3}]

As you can see $x$, $2^x$, and $log_2(x)$ are all plotted on a basic plot between $x = -1$ and $x = 3$. The x-range was easy to restrict, but how can I also restrict the y-range?

Thank you for your time.

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Ahh... got it. Use PlotRange -> {lowerY, upperY}

Plot[{x, 2^x, Log2[x]}, {x, -1, 3}, PlotRange -> {-2, 4}]

share|improve this answer
    
+1 for self-solving AND posting the solution. –  Mr.Wizard Feb 2 '12 at 7:53
add comment

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.