Re: Plotting problem
- To: mathgroup at smc.vnet.net
- Subject: [mg35341] Re: Plotting problem
- From: BobHanlon at aol.com
- Date: Tue, 9 Jul 2002 06:47:50 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 7/8/02 4:39:12 AM, shodgen at mindspring.com writes: >I'm a total Mathematica newbie, and I'm trying to get it to plot a simple >rational eq. in such a way that it indicates where missing points are. >Since I'm not sure how you'd prefer the eq. expressed, I've typed in in >the >parents so there can be no question of where the denominator is, as well >as >a cell expression. > >(3 x^2 - 5 x + 2)/(x - 1) > >Cell[BoxData[ > FractionBox[ > RowBox[{ > RowBox[{"3", > SuperscriptBox["x", "2"]}], "-", > RowBox[{"5", "x"}], "+", "2"}], > RowBox[{"x", "-", "1"}]]], "Input"] > >When I Plot[], this is just draws a straight line. There is no indication >where the hole is. How can I get this "fully correct" graph? > f1[x_] := (3*x^2 - 5*x + 2)/(x - 1); f2[x_] := Evaluate[Simplify[f1[x]]]; Plot[f2[x], {x, 0, 5}, {PlotStyle -> RGBColor[0, 0, 1], Epilog->{ RGBColor[1, 0, 0], AbsolutePointSize[4], ((Point[{x, f2[x]}]/.#)&/@ Solve[Denominator[f1[x]]==0, x])}}]; f1[x_] := (3*x^3-14*x^2+17*x-6)/ ((x - 1)*(x-3)); f2[x_] := Evaluate[Simplify[f1[x]]]; Plot[f2[x], {x, 0, 5}, {PlotStyle -> RGBColor[0, 0, 1], Epilog->{ RGBColor[1, 0, 0], AbsolutePointSize[4], ((Point[{x, f2[x]}]/.#)&/@ Solve[Denominator[f1[x]]==0, x])}}]; Bob Hanlon Chantilly, VA USA