0
$\begingroup$

I found the following possibility to plot a function for a table of parameters:

Plot[Evaluate@Table[a^2 + parameter, {parameter, 0, 10, 2.5}], {a, -10, 10}]

However, I'd need to plot for a list of parameters, say

{parameter,1,2.5,3,7.8,9.572}

How can this be done? My search always directs me to this table approach and the following presents all plots in the same color, which is not really what I want:

 Plot[(a^2 + parameter) /. parameter -> {1, 2.5, 3, 7.8, 9.572}, {a, -10, 10}]
$\endgroup$

1 Answer 1

1
$\begingroup$

Just try (note the new curly brackets):

Plot[Evaluate@Table[a^2 + parameter, {parameter, {1, 2.5, 3, 7.8, 9.572}}], {a, -10, 10}]

enter image description here

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.