RE: Plotting a function of x and y
- To: mathgroup at smc.vnet.net
- Subject: [mg28115] RE: [mg28098] Plotting a function of x and y
- From: "David Park" <djmp at earthlink.net>
- Date: Sat, 31 Mar 2001 02:58:49 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Christopher, There are several different methods. The easiest is to use the ImplicitPlot command from the ImplicitPlot standard package. Needs["Graphics`ImplicitPlot`"] eqn = x + 2*y == 50; ImplicitPlot[eqn, {x, -10, 10}]; Be sure to read the ImplicitPlot documentation because there are several forms for its use. Some equations will require both an x and y iterator. Other methods, which may be useful in some cases are: ysol = Solve[eqn, y][[1,1]] Plot[Evaluate[y /. ysol], {x, -10, 10}]; y -> (50 - x)/2 ParametricPlot[Evaluate[{x, y} /. ysol], {x, -10, 10}]; David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ > -----Original Message----- > From: Christopher Deacon [mailto:cdeacon at physics.mun.ca] To: mathgroup at smc.vnet.net > Sent: Friday, March 30, 2001 4:13 AM > To: mathgroup at smc.vnet.net > Subject: [mg28115] [mg28098] Plotting a function of x and y > > > How do I plot the function > > 3 x+ 2y = 50? > > I suppose I could use Solve to rewrite the equation in > slope-intercept form, > but is there a simpler way? > > Chris > > -- > +-----------------------------+----------------------------+ > | Christopher Deacon | (709) 737-7631 > | Dept of Physics and Physical| cdeacon at physics.mun.ca > | Oceanography > | Memorial University of Nfld > +----------------------------+-----------------------------+ > | http://www.physics.mun.ca/~cdeacon > +----------------------------------------------------------+ > > > > > >