Re: How to plot this
- To: mathgroup at smc.vnet.net
- Subject: [mg64445] Re: [mg64416] How to plot this
- From: "David Park" <djmp at earthlink.net>
- Date: Fri, 17 Feb 2006 04:11:59 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
y[x] has never been defined so how could Mathematica plot it? Solve for y and then assign a plotting function to the result. yplot[x_] = y /. Part[Solve[ x + y == 2*x*y, y], 1, 1] x/(-1 + 2*x) Needs["Graphics`Colors`"] Plot[yplot[x], {x, 1, 3}, Frame -> True, FrameLabel -> {x, y}, PlotRange -> All, PlotLabel -> SequenceForm["y == ", yplot[x]], Background -> Linen, ImageSize -> {450, Automatic}]; For a plot over a domain that contains the singularity... Plot[yplot[x], {x, -1, 3}, Frame -> True, FrameLabel -> {x, y}, Axes -> False, PlotRange -> Automatic, PlotLabel -> SequenceForm["y == ", yplot[x]], Background -> Linen, ImageSize -> {450, Automatic}]; If you want to get rid of the 'return line' you could use the DrawGraphics package from my web site. Needs["DrawGraphics`DrawingMaster`"] Draw2D[ {Draw[yplot[x], {x, -1, 3}] /. SplitLineOnVertical[10]}, Frame -> True, FrameLabel -> {x, y}, Axes -> {True, False}, AxesStyle -> Gray, PlotRange -> Automatic, PlotLabel -> SequenceForm["y == ", yplot[x]], Background -> Linen, ImageSize -> {450, Automatic}]; If you want a faster answer to your question you could give a good email address, otherwise there is usually a day's delay in the posted replies. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: siegmund natter [mailto:nobody at nomail.com] To: mathgroup at smc.vnet.net Hello Can anyone tell why this is wrong? eqn1 = x + y == 2*x*y; eqn1 /.y -> y[x]; Plot[y[x], {x, 1, 3}] How do I do it correctly? (This is just an example; I want to do this with a much more difficult equation) Thanks a lot. (I am using Mathematica 5.1)