# How do I define a function that, when given a list of parameters, plots a family of functions?

So far I've got this:

draw[a_, b_] := Plot[{f[a, b[[1]], x], f[a, b[[2]], x]}, {x, 0, 5}]


The function draw will be used like this:

draw[10, {4, 7}]


The example is written for the case with two elements in the list that is the second argument. How do I do it when the second argument is a list with any number of elements?

-
It would help us to help you if you edited your question to include an example of kind of function you would give for f. –  m_goldberg Jan 4 '13 at 2:07

## 1 Answer

You can use Map:

draw[a_, b_] := Plot[Evaluate[f[a, #, x] & /@ b], {x, 0, 5}]

-
+1 (see also this frequently asked question) –  Jens Jan 4 '13 at 1:45
Thank you very much. –  user5266 Jan 4 '13 at 11:22