Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1997
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1997

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

Search the Archive

Re: Graphing with Mmm2.0

  • To: mathgroup at smc.vnet.net
  • Subject: [mg6148] Re: [mg6138] Graphing with Mmm2.0
  • From: "w.meeussen" <w.meeussen at solair4b.eunet.be>
  • Date: Mon, 24 Feb 1997 00:08:52 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

At 00:10 23-02-97 -0500, you wrote:
>I want to make a plot of a function. (1/(a-x) ) where a is a constant. I
>want to do it from 0 to a .And i want a to vary..how can i do that?
>I tried Plot[1/(a-x),{x,0,a}] but it didn't work.
>
>
>Thanks
>John Papadakis
>
>
>

John,
I would first make a table of all functions to be plotted, and keep the
parameter value as the first item of a list,

Table[{a, 1/(a - x)}, {a, 0.4, 1.7, 0.2}]

and then apply the plotfunction (as a pure function) to the second part
('#2'), while passing the parameter a from the first part ('#1')

In[12]:=
Apply[Plot[#2, {x, 0, #1}, 
    DisplayFunction -> Identity] & , 
  Table[{a, 1/(a - x)}, {a, 0.4, 1.7, 0.2}], 1]

In[13]:=
Show[%, DisplayFunction->$DisplayFunction]


yes, I love 'pure functions' ...

Dr. Wouter L. J. MEEUSSEN
w.meeussen at solair4b.eunet.be



  • Prev by Date: Re: Graphing with Mmm2.0
  • Next by Date: Solving non-linear equations
  • Previous by thread: Re: Graphing with Mmm2.0
  • Next by thread: Solving non-linear equations