MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Ploting a changing constant

  • To: mathgroup at smc.vnet.net
  • Subject: [mg64800] Re: [mg64740] Ploting a changing constant
  • From: "Christopher Arthur" <pannoniara at aol.com>
  • Date: Sat, 4 Mar 2006 02:35:12 -0500 (EST)
  • References: <200406180612.CAA10684@smc.vnet.net> <200406190831.EAA27575@smc.vnet.net> <200603021147.GAA05121@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Try it with a map:

For example-

Plot[y[x,##],{x,0,33}]&/@{10,20,30,40,50}

The ## is a pure function variable, the & says this is the end of the
function, and the /@ means map the following list pointwise into the
function.

Best,

Chris

----- Original Message ----- 
From: "Mary Beth Mulcahy" <Mary.Mulcahy at colorado.edu>
To: mathgroup at smc.vnet.net
Subject: [mg64800] [mg64740] Ploting a changing constant


> OK, so this has to be an easy one.  I am trying to plot a function several
> times
> for a variety of values of a constant.  For example:
>
> y[x_, a_]:=a*x
>
> I want to plot a=10, a=20 overlaying one another.  Currently I simply
> rewrite
> the equation however many times I need to change the variable.  For
> example:
>
> DisplayTogether[Plot[y[x, 10], {x, 0, 33}],Plot[y[x,20], {x, 0,
> 33}],Plot[y[x,30], {x, 0, 33}],Plot[y[x,40], {x, 0, 33}],Plot[y[50], {x,
> 0,
> 33}]]
>
> I'm plotting this equation 15 times with a increasing in steps of ten.
> Seems to
> me there should be a single command to do this rather than cut and paste
> 10
> times (and then go back in to change the variable by hand).  Something
> like in
> Sum[] where you can state the beginingvalue, end value and step size.
>
> Thanks for the help.
>
> mary beth
>
>
>
>
> --
> Department of Chemistry and Biochemistry
> University of Colorado
> Chemistry 76
> Boulder, CO  80309-0215
>
> (303) 492-0579
>
>



  • Prev by Date: Problem with Import and/or J/Link
  • Next by Date: Re: Plot[] of smooth function results in wildly fluctuating graph?
  • Previous by thread: Ploting a changing constant
  • Next by thread: Re: Ploting a changing constant