1
$\begingroup$

How can I combine all these plots into one one graph?

f[a_, b_, c_] := (a*x^2 + b*x + c)/3;
tup1 := RandomInteger[5, {15, 3}];
Plot[f[##], {x, 0, 10}] & @@@ tup1
$\endgroup$
1
  • 2
    $\begingroup$ Plot[f @@@ tup1 // Evaluate, {x, 0, 10}] $\endgroup$
    – cvgmt
    Feb 8, 2021 at 7:34

1 Answer 1

3
$\begingroup$

If the plots are already created, you can combine them using Show and post-process to change line colors:

tup = tup1;
plots = Plot[f[##], {x, 0, 10}] & @@@ tup;

Show[plots]

enter image description here

colors = ColorData[97] /@ Range[Length @ tup];

Legended[Show[plots, ImageSize -> Large] /. _?ColorQ :> 
   Last[colors = RotateLeft[colors]], 
  LineLegend[colors, tup]]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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