Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do I set domain and range in grapher.app?

Hey, I'm brand new to this program, and i can't figure out for the life of me how to set the domain and range of an equation.

For example, if i had the equation y=x^2 , how would i go about setting the x values>0?
Any quick replies are very appreciated! Its rather urgent.

17 Powerbook G4

Posted on Mar 17, 2011 12:39 PM

Reply
Question marked as Best reply

Posted on Apr 1, 2011 6:04 AM

Apple's Grapher does, in fact, have this capability. It's a shame that Apple's documentation is very poor. Grapher is a wonderful application. In any case, here is how to do it:

The general syntax is:
y = condition(s) ? expression

So for example, if you only wanted to graph the positive x values of x^2, you would enter:
y = x > 0 ? x^2

You can also have multiple conditions, separated with an ampersand (&). For example, the sinx graph from -pi to pi:
y = x > -π & x < π ? sinx

You can even limit the range. Example:
y = y < 5 ? x^2
This only shows the parabola up to the y = 5 line.

Again, you can mix and match any set of conditions you desire with the ampersand, including limits on the domain and range within the same set of conditions. Example of x^2 only showing positive x values up to the y = 5 line:
y = y < 5 & x > 0 ? x^2

Hope this helps.
14 replies
Question marked as Best reply

Apr 1, 2011 6:04 AM in response to DR46

Apple's Grapher does, in fact, have this capability. It's a shame that Apple's documentation is very poor. Grapher is a wonderful application. In any case, here is how to do it:

The general syntax is:
y = condition(s) ? expression

So for example, if you only wanted to graph the positive x values of x^2, you would enter:
y = x > 0 ? x^2

You can also have multiple conditions, separated with an ampersand (&). For example, the sinx graph from -pi to pi:
y = x > -π & x < π ? sinx

You can even limit the range. Example:
y = y < 5 ? x^2
This only shows the parabola up to the y = 5 line.

Again, you can mix and match any set of conditions you desire with the ampersand, including limits on the domain and range within the same set of conditions. Example of x^2 only showing positive x values up to the y = 5 line:
y = y < 5 & x > 0 ? x^2

Hope this helps.

Mar 17, 2011 2:48 PM in response to DR46

Unfortunately, neither of those answers were what I'm looking for.

I should have specified, i want to be able to set the domain and range of a specific line. I'm looking for how I can set the restrictions to an equation, I.E. the domain and range.

The first post told me how to set the domain and range of the axes, but not of a line.


It is hard to communicate exactly what i mean, but i hope this is enough. Thanks for the answers, anyhow.

Mar 17, 2011 4:21 PM in response to DR46

You mean "curve," not "line." I think what you're saying is that you want to graph an equation such as y=f(x), x>0, but showing part of the negative x-axis. I don't see any way to do that directly.

Restrict the x-axis to show only the part of the curve you want, and save the graph as a TIFF. Save a blank grid as a TIFF. Composite the first TIFF onto the second one in a bitmap editor. Either that, or you need a much more flexible graphing program, such as gnuplot.

Feb 3, 2015 2:18 PM in response to Brad DT

I've been using grapher for years & had *no idea* you could do this so easily. I've wasted so much time finding parameterizations instead. How did you discover this? Do you know of a good manual / source / site for what Grapher can do? I know it's very powerful, but now I'm wondering about what else I've been doing the hard way!


Thanks in advance,

Rax

Jun 28, 2016 1:06 PM in response to Linc Davis

I know this is quite old but it came up in my search. Is it possible to un-mark this as the answer (appears as the response that is marked as "Solved" in response to the OP) since a later post from Brad DT actually gave the correct answer? And mark Brad DT's as "Solved"? Or is that under the control of the OP? (I found the answer in an old post elsewhere and was coming back to post it here when the full thread revealed the answer was here all along).

How do I set domain and range in grapher.app?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.