Re: Draw two functions in a graph, one of them does also have a parameter.
- To: mathgroup at smc.vnet.net
- Subject: [mg90214] Re: Draw two functions in a graph, one of them does also have a parameter.
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Wed, 2 Jul 2008 05:32:12 -0400 (EDT)
On 7/1/08 at 7:01 AM, vexie.infamous at googlemail.com (Felipe
Mannshardt) wrote:
>Is there a way to do a Plot do draw this two functions in the same
>graph ? I am asking because i am having problems due the
>parameter "a".
>I have,
>f(x)= -x^2 + 6x g(x)= ax
It is definitely preferable to post Mathematica code here
>i want to draw them in the same graphic and with a from 0 to 3 . . .
>Can not think of a way of doing this, due the "a" parameter . . .
>Plot[{f[x],[g[a][x]},{x,0,7},{a,0,3}]
Here are two ways of getting a combined plot.
=46irst, you could plot a family of curves for discrete values of
a. For example
f = -x^2 + 6 x;
g = a x;
Plot[Evaluate[Join[{f}, Table[g, {a, 0, 3}]]], {x, 0, 7}]
alternatively, you could show an area for g and a curve for f.
=46or example,
Show[Plot[f, {x, 0, 7}],
Plot[g /. a -> 3, {x, 0, 7}, Filling -> Bottom], PlotRange -> All]
Basically, you need to define the a parameter and decide what it
is you want to show.