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

I have a function g(x,y) and would like to plot it as g(x) with a slider to vary y. What I currently have is a g(x,y) plotted as g(x) but with y as a parameter which I can adjust:


That works fine, but now I'd like to be able to vary the upper value of the x-axis so that we can adjust how much of the graph we see (or how much of the x-axis we see). This is what I've tried (but didn't work):

share|improve this question
up vote 4 down vote accepted

Like this?

g[x_, y_] := Sin[y x] 

Mathematica graphics

share|improve this answer
Thanks a lot - what does the 10 in {xmax, 10} do? – tukmajerb Mar 26 '14 at 2:16
@tukmajerb, it defines the initial value. You should read the documentation, it is really good. Highlight Manipulate and press F1. – rhermans Mar 26 '14 at 7:27

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.