Re: Plotting 2d graphs?
- To: mathgroup at smc.vnet.net
- Subject: [mg57181] Re: [mg57168] Plotting 2d graphs?
- From: "David Park" <djmp at earthlink.net>
- Date: Fri, 20 May 2005 04:43:13 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Paul, To plot the quadratic curve, let's first find the roots so we can better center the plot. Notice that an equation is entered with "==" and not "=". Solve[2x^2 + 16x + 32 == 0] {{x -> -4}, {x -> -4}} Since there is a double root at -4, let's plot from -24 to 16 using the Plot statement. Notice that in the Plot statement we use only the expression that is being plotted and not an equation. Plot[2x^2 + 16x + 32, {x, -24, 16}]; For the ellipse we want to use ImplicitPlot and for that we have to load the package. In ImplicitPlot we do use the equation. Needs["Graphics`ImplicitPlot`"] ImplicitPlot[(x - 5)^2/16 + (y + 4)^2/25 == 1, {x, 0, 10}]; For fancier plotting we could use some of the plotting options. To make the same plot with a frame, labels and a colored background we could use... Needs["Graphics`Colors`"] ImplicitPlot[(x - 5)^2/16 + (y + 4)^2/25 == 1, {x, 0, 10}, Axes -> False, Frame -> True, FrameLabel -> {x, y}, PlotLabel -> (x - 5)^2/16 + (y + 4)^2/25 == 1, Background -> Linen, ImageSize -> 450]; David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: Paul Hughes [mailto:psidoc at gmail.com] To: mathgroup at smc.vnet.net I'm having trouble using the basic 2d plot function. I want to be able to plot things such as a simple quadratic or ellipse: Examples: 2x^2 + 16x + 32 = 0 (Quadratic) (x-5)^2/16 + (y+4)^2/25 = 1 (Ellipse) But have failed to do so, having tried every variation i can think of to get it to work.