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 am new user.

I am plotting "y = x^3". My "x" domain is "{x, -5, 5}", but then it scales for all "y" values.

Is there anyway to zoom in, or have it plot/display a limited "y" range of values? The scaled "y" values make the graph look flatter, than it is for "y = x^3".

I have tried looking at examples in the documentation for getting the scale I want.

share|improve this question

marked as duplicate by Mr.Wizard Jan 27 at 7:20

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.

    
Hello, there are many useful options for Plot. Take a look at PlotRange, AspectRatio, ImageSize.You may also be interested in this topic: How to manimpulate 2D plots. –  Kuba Jan 27 at 5:52

1 Answer 1

up vote 1 down vote accepted

Mathematica unfortunately does not have the same zooming features that Matlab plot has. In 3D one can zoom using the mouse. In 2D can can only enlarge or reduce the size of the overall plot using the mouse. But nothing build-in like Matlab's zooming into specific area in the plot with the mouse. May be in V 10 Mathematica will add this feature, which is very important and missing now.

So, other than having to redo the plot each time and change the options (plotrange, etc..), it is not hard to make a quick Manipulate to do all this yourself. Here is a quick example

Manipulate[
 Plot[x^3, {x, -5, 5}, PlotRange -> {{-xRange, xRange}, {-yRange, yRange}}, 
      ImagePadding -> 30, ImageSize -> 300, Frame -> True],
 {{xRange, 5, "x limit?"}, 1, 5, .1},
 {{yRange, 5, "y limit?"}, 1, 100, 1}
 ]

enter image description here

Now you can move the range for x and y and the plot will update.

share|improve this answer
    
Thank you, it solves my problem. I am new to Mathematica, and do you know of any good books that would give me a solid foundation on using Mathematica? –  GAL Jan 27 at 6:14

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