I have a 2D Plot of 3 functions
Plot[ { f1[x], f2[x], f3[x] }, { x, 8, 18 } ]
where I want f3[x] only plotted for the range [10, 18] instead of [8, 18]. Is that possible?
I have a 2D Plot of 3 functions
Plot[ { f1[x], f2[x], f3[x] }, { x, 8, 18 } ]
where I want f3[x] only plotted for the range [10, 18] instead of [8, 18]. Is that possible?
You can use ConditionalExpression (new in version 8) e.g.
Plot[{f1[x], f2[x], ConditionalExpression[f3[x], x > 10]}, {x, 8, 18}]
For example, let's define :
f1[x_] := -4/5 Sin[x]
f2[x_] := Sin[2 x]^2 - 1/2
f3[x_] := Sin[3 x]^5
now
Plot[{ f1[x], f2[x], ConditionalExpression[f3[x], x > 10]}, {x, 8, 18},
PlotStyle -> {Thick, Thick, Thickness[0.007]}]

The thickest curve is the graph of of f3 in the expected region though f3 is defined for all real (even complex) numbers.
Plot[{f1[x], f2[x], Piecewise[{{f3[x], x > 10}}, Indeterminate]}, {x, 8, 18}].
– J. M.'s missing motivation
Jun 20 '12 at 10:49
ConditionalExpression does not. Please post that as an answer, or I shall.
– Mr.Wizard
Jun 20 '12 at 17:43
A solution using individual plots combined using Show.
f1[x_] := 1/4 Sin[x]
f2[x_] := 1/2 Sin[2 x]^2
f3[x_] := Sin[3 x]^3
Define a function to plot some functions over some ranges:
Attributes@plotFuncs = {HoldFirst};
plotFuncs[{funcs_, ranges_, opts_}] :=
Show[Block[Evaluate@Union@ranges[[All, 1]],
MapThread[
Plot[#1[First@#2], #2, #3] &, {funcs, ranges,
opts}]], PlotRange -> All]
Plot the three functions:
plotFuncs[{{f1, f2, f3}, {{x, 8, 18}, {y, 8, 18}, {x, 10, 18}},
{PlotStyle -> Red, PlotStyle -> Blue, PlotStyle -> Darker@Green}}]
At Mr. Wizard's urging: Plot[{f1[x], f2[x], Piecewise[{{f3[x], x > 10}}, Indeterminate]}, {x, 8, 18}] works nicely as an alternative to Artes's answer.