f[x_?NumericQ] := {x, x^2} These three expressions all produce the same output. Quiet is used in each case to suppress the message "Part::partw: "Part 2 of f[x] does not exist."
Module[{fwrap1, fwrap2, tmp}, fwrap1[x_] := (tmp = f[x])[[1]]; fwrap2[x_] := tmp[[2]]; Plot[{fwrap1[x], fwrap2[x]}, {x, 0, 1}, Evaluated -> True, PlotLegends -> {x, x^2}]] // Quiet Module[{fwrap1, fwrap2, tmp}, fwrap1[x_] = (tmp = f[x])[[1]]; fwrap2[x_] = tmp[[2]]; Plot[{fwrap1[x], fwrap2[x]}, {x, 0, 1}, PlotLegends -> {x, x^2}]] // Quiet Module[{tmp}, Plot[ {(tmp = f[x])[[1]], tmp[[2]]}, {x, 0, 1}, Evaluated -> True, PlotLegends -> {x, x^2}]] // Quiet EDIT:
Looking at the number of times at f[x] is evaluated
f[x_?NumericQ] := (n++; {x, x^2}) n = 0; Module[{fwrap1, fwrap2, tmp}, fwrap1[x_] := (tmp = f[x])[[1]]; fwrap2[x_] := tmp[[2]]; Plot[{fwrap1[x], fwrap2[x]}, {x, 0, 1}, Evaluated -> True, PlotLegends -> {x, x^2}]] // Quiet; n (* 159 *) n = 0; Module[{fwrap1, fwrap2, tmp}, fwrap1[x_] = (tmp = f[x])[[1]]; fwrap2[x_] = tmp[[2]]; Plot[{fwrap1[x], fwrap2[x]}, {x, 0, 1}, PlotLegends -> {x, x^2}]] // Quiet; n (* 159 *) n = 0; Module[{tmp}, Plot[{(tmp = f[x])[[1]], tmp[[2]]}, {x, 0, 1}, Evaluated -> True, PlotLegends -> {x, x^2}]] // Quiet; n (* 159 *) n = 0; Plot[{f[x][[1]], f[x][[2]]}, {x, 0, 1}]; n (* 238 *) 